Skip to content

Commit 33b607b

Browse files
committed
👷 Setup GHA
1 parent 65a5b53 commit 33b607b

File tree

9 files changed

+261
-149
lines changed

9 files changed

+261
-149
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
45+
uses: github/codeql-action/init@v3
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
56+
uses: github/codeql-action/autobuild@v3
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
70+
uses: github/codeql-action/analyze@v3

.github/workflows/coverage.yml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: Ruby - Coverage
1+
name: Test Coverage
22

33
env:
4-
K_SOUP_COV_MIN_BRANCH: 82
5-
K_SOUP_COV_MIN_LINE: 94
4+
K_SOUP_COV_MIN_BRANCH: 100
5+
K_SOUP_COV_MIN_LINE: 100
66
K_SOUP_COV_MIN_HARD: true
7+
K_SOUP_COV_DO: true
8+
K_SOUP_COV_COMMAND_NAME: "RSpec Coverage"
79

810
on:
911
push:
1012
branches:
1113
- 'main'
12-
- '*-stable'
13-
- '*-dev'
1414
tags:
1515
- '!*' # Do not execute on tags
1616
pull_request:
@@ -32,48 +32,54 @@ jobs:
3232
test:
3333
name: Specs with Coverage - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
3434
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
35-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
36-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
37-
CI_CODECOV: true
38-
COVER_ALL: true
3935
runs-on: ubuntu-latest
4036
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
37+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
38+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
4139
strategy:
40+
fail-fast: false
4241
matrix:
43-
rubygems:
44-
- latest
45-
bundler:
46-
- latest
47-
gemfile:
48-
- coverage
49-
ruby:
50-
- '3.1'
42+
include:
43+
# Coverage
44+
- ruby: "3.4"
45+
appraisal: "coverage"
46+
exec_cmd: "rake rspec"
47+
gemfile: "Appraisal.root"
48+
rubygems: latest
49+
bundler: latest
5150

5251
steps:
53-
- name: CodeClimate Install
54-
uses: amancevice/setup-code-climate@v1
52+
- uses: amancevice/setup-code-climate@v2
53+
name: CodeClimate Install
5554
if: ${{ github.event_name != 'pull_request' }}
5655
with:
57-
cc_test_reporter_id: "${{ secrets.CC_TEST_REPORTER_ID }}"
56+
cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }}
5857

5958
- name: Checkout
6059
uses: actions/checkout@v4
6160

62-
- name: Setup Ruby & Bundle
61+
- name: Setup Ruby & RubyGems
6362
uses: ruby/setup-ruby@v1
6463
with:
6564
ruby-version: "${{ matrix.ruby }}"
6665
rubygems: "${{ matrix.rubygems }}"
6766
bundler: "${{ matrix.bundler }}"
68-
bundler-cache: true
67+
bundler-cache: false
6968

7069
- name: CodeClimate Pre-build Notification
7170
run: cc-test-reporter before-build
7271
if: ${{ github.event_name != 'pull_request' }}
7372
continue-on-error: ${{ matrix.experimental != 'false' }}
7473

75-
- name: Run tests
76-
run: bundle exec rake test
74+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
75+
# We need to do this first to get appraisal installed.
76+
# NOTE: This does not use the main Gemfile at all.
77+
- name: Bundle install for Appraisal ${{ matrix.appraisal }}
78+
run: bundle
79+
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
80+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
81+
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }}
82+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
7783

7884
- name: CodeClimate Post-build Notification
7985
run: cc-test-reporter after-build
@@ -92,7 +98,7 @@ jobs:
9298
hide_complexity: true
9399
indicators: true
94100
output: both
95-
thresholds: '93 82'
101+
thresholds: '69 80'
96102
continue-on-error: ${{ matrix.experimental != 'false' }}
97103

98104
- name: Add Coverage PR Comment
@@ -106,5 +112,10 @@ jobs:
106112
- name: Coveralls
107113
uses: coverallsapp/github-action@master
108114
with:
109-
github-token: "${{ secrets.GITHUB_TOKEN }}"
115+
github-token: ${{ secrets.GITHUB_TOKEN }}
110116
continue-on-error: ${{ matrix.experimental != 'false' }}
117+
118+
- name: Upload results to Codecov
119+
uses: codecov/codecov-action@v5
120+
with:
121+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: 'Checkout Repository'
1818
uses: actions/checkout@v4
1919
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@v2
20+
uses: actions/dependency-review-action@v4

.github/workflows/heads.yml

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Ruby Heads Matrix
1+
name: Heads Compat Matrix
22

33
env:
44
K_SOUP_COV_DO: false
@@ -7,8 +7,6 @@ on:
77
push:
88
branches:
99
- 'main'
10-
- '*-stable'
11-
- '*-dev'
1210
tags:
1311
- '!*' # Do not execute on tags
1412
pull_request:
@@ -28,37 +26,59 @@ concurrency:
2826

2927
jobs:
3028
test:
31-
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
29+
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
3230
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
33-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
34-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
3531
runs-on: ubuntu-latest
3632
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
33+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
34+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
3735
strategy:
3836
fail-fast: true
3937
matrix:
40-
rubygems:
41-
- latest
42-
bundler:
43-
- latest
44-
gemfile:
45-
- vanilla
46-
ruby:
47-
- "ruby-head"
48-
# TODO: Use rspec-pending_for to exempt (and document) truffleruby-head from specific tests that are failing
49-
# - truffleruby-head
38+
include:
39+
# ruby-head
40+
- ruby: "ruby-head"
41+
appraisal: "ruby-head"
42+
exec_cmd: "rake rspec"
43+
gemfile: "Appraisal.root"
44+
rubygems: latest
45+
bundler: latest
46+
47+
# truffleruby-head
48+
- ruby: "truffleruby-head"
49+
appraisal: "truffleruby-head"
50+
exec_cmd: "rake rspec"
51+
gemfile: "Appraisal.root"
52+
rubygems: latest
53+
bundler: latest
54+
55+
# jruby-head
56+
# Error output has a significantly different format in JRuby :(
57+
# - ruby: "jruby-head"
58+
# appraisal: "jruby-head"
59+
# exec_cmd: "rake rspec"
60+
# gemfile: "Appraisal.root"
61+
# rubygems: latest
62+
# bundler: latest
5063

5164
steps:
5265
- name: Checkout
5366
uses: actions/checkout@v4
5467

55-
- name: Setup Ruby & Bundle
68+
- name: Setup Ruby & RubyGems
5669
uses: ruby/setup-ruby@v1
5770
with:
58-
ruby-version: "${{ matrix.ruby }}"
59-
rubygems: "${{ matrix.rubygems }}"
60-
bundler: "${{ matrix.bundler }}"
61-
bundler-cache: true
71+
ruby-version: ${{ matrix.ruby }}
72+
rubygems: ${{ matrix.rubygems }}
73+
bundler: ${{ matrix.bundler }}
74+
bundler-cache: false
6275

63-
- name: Run tests
64-
run: bundle exec rake test
76+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
77+
# We need to do this first to get appraisal installed.
78+
# NOTE: This does not use the main Gemfile at all.
79+
- name: Bundle install for Appraisal ${{ matrix.appraisal }}
80+
run: bundle
81+
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
82+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
83+
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }}
84+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/hoary.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- ruby: "2.2"
3535
appraisal: "ruby-2-2"
3636
exec_cmd: "rake rspec"
37-
gemfile: "Appraisal.root"
37+
gemfile: "Appraisal.hoary"
3838
rubygems: "2.7.11"
3939
bundler: "1.17.3"
4040

@@ -55,6 +55,15 @@ jobs:
5555
# NOTE: This does not use the main Gemfile at all.
5656
- name: Bundle install for Appraisal ${{ matrix.appraisal }}
5757
run: bundle
58+
- name: Overwrite Appraisals
59+
run: |
60+
cat <<EOF > Appraisals
61+
# frozen_string_literal: true
62+
appraise "ruby-2-2" do
63+
gem "mutex_m", "~> 0.2"
64+
gem "stringio", "~> 3.0"
65+
end
66+
EOF
5867
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
5968
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
6069
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }}

.github/workflows/legacy.yml

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
name: Legacy Ruby Support
1+
name: Legacy Compat (EOL, Ruby 3.0) Matrix
2+
3+
env:
4+
K_SOUP_COV_DO: false
25

36
on:
47
push:
58
branches:
69
- 'main'
7-
- '*-stable'
8-
- '*-dev'
910
tags:
1011
- '!*' # Do not execute on tags
1112
pull_request:
@@ -14,45 +15,53 @@ on:
1415
# Allow manually triggering the workflow.
1516
workflow_dispatch:
1617

18+
permissions:
19+
contents: read
20+
1721
# Cancels all previous workflow runs for the same branch that have not yet completed.
1822
concurrency:
1923
# The concurrency group contains the workflow name and the branch name.
20-
group: ${{ github.workflow }}-${{ github.ref }}
24+
group: "${{ github.workflow }}-${{ github.ref }}"
2125
cancel-in-progress: true
2226

2327
jobs:
2428
test:
25-
name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
29+
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
2630
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
27-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
28-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
31+
runs-on: ubuntu-22.04
32+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
33+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
34+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
2935
strategy:
3036
fail-fast: false
3137
matrix:
32-
experimental: [false]
33-
rubygems:
34-
- "2.7.11"
35-
bundler:
36-
- none
37-
gemfile:
38-
- vanilla
39-
ruby:
40-
- "3.0"
41-
- "2.7"
42-
- "2.6"
43-
- "2.5"
44-
- "2.4"
45-
runs-on: ubuntu-20.04
46-
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
38+
include:
39+
# Ruby 3.0
40+
- ruby: "3.0"
41+
appraisal: "ruby-3-0"
42+
exec_cmd: "rake rspec"
43+
gemfile: "Appraisal.root"
44+
rubygems: '3.5.23'
45+
bundler: '2.5.23'
46+
4747
steps:
4848
- name: Checkout
49-
uses: actions/checkout@v3
50-
- name: Setup Ruby & Bundle
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Ruby & RubyGems
5152
uses: ruby/setup-ruby@v1
5253
with:
5354
ruby-version: ${{ matrix.ruby }}
5455
rubygems: ${{ matrix.rubygems }}
5556
bundler: ${{ matrix.bundler }}
56-
bundler-cache: true
57-
- name: Run tests
58-
run: bundle exec rake test
57+
bundler-cache: false
58+
59+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
60+
# We need to do this first to get appraisal installed.
61+
# NOTE: This does not use the main Gemfile at all.
62+
- name: Bundle install for Appraisal ${{ matrix.appraisal }}
63+
run: bundle
64+
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
65+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
66+
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }}
67+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

0 commit comments

Comments
 (0)