Skip to content

Commit 066ac26

Browse files
committed
👷 Setup appraisals
1 parent 622f473 commit 066ac26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1325
-448
lines changed

.github/workflows/ancient.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: MRI 2.3, 2.4, 2.5 (EOL)
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- '*-stable'
8+
tags:
9+
- '!*' # Do not execute on tags
10+
pull_request:
11+
branches:
12+
- '*'
13+
# Allow manually triggering the workflow.
14+
workflow_dispatch:
15+
16+
# Cancels all previous workflow runs for the same branch that have not yet completed.
17+
concurrency:
18+
# The concurrency group contains the workflow name and the branch name.
19+
group: "${{ github.workflow }}-${{ github.ref }}"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
test:
24+
name: Specs ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
25+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
26+
runs-on: ubuntu-22.04
27+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
28+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
29+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
# Ruby 2.3
35+
- ruby: "ruby-2.3"
36+
appraisal: "ruby-2-3"
37+
exec_cmd: "rake test"
38+
gemfile: "Appraisal.root"
39+
rubygems: "3.3.27"
40+
bundler: "2.3.27"
41+
42+
# Ruby 2.4
43+
- ruby: "ruby-2.4"
44+
appraisal: "ruby-2-4"
45+
exec_cmd: "rake test"
46+
gemfile: "Appraisal.root"
47+
rubygems: "3.3.27"
48+
bundler: "2.3.27"
49+
50+
# Ruby 2.5
51+
- ruby: "ruby-2.5"
52+
appraisal: "ruby-2-5"
53+
exec_cmd: "rake test"
54+
gemfile: "Appraisal.root"
55+
rubygems: "3.3.27"
56+
bundler: "2.3.27"
57+
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
62+
- name: Setup Ruby & RubyGems
63+
uses: ruby/setup-ruby@v1
64+
with:
65+
ruby-version: ${{ matrix.ruby }}
66+
rubygems: ${{ matrix.rubygems }}
67+
bundler: ${{ matrix.bundler }}
68+
bundler-cache: false
69+
70+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
71+
# We need to do this first to get appraisal installed.
72+
# NOTE: This does not use the primary Gemfile at all.
73+
- name: Install Root Appraisal
74+
run: bundle
75+
- name: Appraisal for ${{ matrix.appraisal }}
76+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
77+
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
78+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/coverage.yml

Lines changed: 63 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
name: Code Coverage
1+
name: Test Coverage
22

33
env:
4-
CI_CODECOV: true
5-
COVER_ALL: true
4+
K_SOUP_COV_MIN_BRANCH: 98
5+
K_SOUP_COV_MIN_LINE: 98
6+
K_SOUP_COV_MIN_HARD: true
7+
K_SOUP_COV_FORMATTERS: "html,rcov,lcov,json,tty"
8+
K_SOUP_COV_DO: true
9+
K_SOUP_COV_MULTI_FORMATTERS: true
10+
K_SOUP_COV_COMMAND_NAME: "RSpec Coverage"
611

712
on:
813
push:
914
branches:
10-
- 'main'
11-
- '*-maintenance'
12-
- '*-dev'
13-
- '*-stable'
15+
- 'master'
1416
tags:
1517
- '!*' # Do not execute on tags
1618
pull_request:
@@ -19,96 +21,102 @@ on:
1921
# Allow manually triggering the workflow.
2022
workflow_dispatch:
2123

24+
permissions:
25+
contents: read
26+
2227
# Cancels all previous workflow runs for the same branch that have not yet completed.
2328
concurrency:
2429
# The concurrency group contains the workflow name and the branch name.
25-
group: ${{ github.workflow }}-${{ github.ref }}
30+
group: "${{ github.workflow }}-${{ github.ref }}"
2631
cancel-in-progress: true
2732

2833
jobs:
29-
test:
30-
name: Specs with Coverage - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
34+
coverage:
35+
name: Code Coverage on ${{ matrix.ruby }}@current
3136
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
37+
runs-on: ubuntu-latest
38+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
39+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
40+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
3241
strategy:
3342
fail-fast: false
3443
matrix:
35-
experimental: [false]
36-
rubygems:
37-
- latest
38-
bundler:
39-
- latest
40-
ruby:
41-
- "2.7"
44+
include:
45+
# Coverage
46+
- ruby: "ruby"
47+
appraisal: "coverage"
48+
exec_cmd: "rake test"
49+
gemfile: "Appraisal.root"
50+
rubygems: latest
51+
bundler: latest
4252

43-
runs-on: ubuntu-latest
44-
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
4553
steps:
46-
- uses: amancevice/setup-code-climate@v0
54+
- uses: amancevice/setup-code-climate@v2
4755
name: CodeClimate Install
48-
if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
56+
if: ${{ github.event_name != 'pull_request' }}
4957
with:
5058
cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }}
5159

5260
- name: Checkout
53-
uses: actions/checkout@v3
61+
uses: actions/checkout@v4
5462

55-
- name: Setup Ruby & Bundle
63+
- name: Setup Ruby & RubyGems
5664
uses: ruby/setup-ruby@v1
5765
with:
58-
ruby-version: ${{ matrix.ruby }}
59-
rubygems: ${{ matrix.rubygems }}
60-
bundler: ${{ matrix.bundler }}
61-
bundler-cache: true
62-
63-
- name: CodeClimate Pre-build Notification
64-
run: cc-test-reporter before-build
65-
if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
66-
continue-on-error: ${{ matrix.experimental != 'false' }}
66+
ruby-version: "${{ matrix.ruby }}"
67+
rubygems: "${{ matrix.rubygems }}"
68+
bundler: "${{ matrix.bundler }}"
69+
bundler-cache: false
6770

68-
- name: Run tests
69-
run: bundle exec rake test
70-
71-
- name: CodeClimate Post-build Notification
72-
run: cc-test-reporter after-build
73-
if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
74-
continue-on-error: ${{ matrix.experimental != 'false' }}
71+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
72+
# We need to do this first to get appraisal installed.
73+
# NOTE: This does not use the primary Gemfile at all.
74+
- name: Install Root Appraisal
75+
run: bundle
76+
- name: Appraisal for ${{ matrix.appraisal }}
77+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
78+
- name: Tests for ${{ matrix.ruby }}@current via ${{ matrix.exec_cmd }}
79+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
7580

7681
- name: Code Coverage Summary Report
77-
uses: irongut/CodeCoverageSummary@v1.2.0
82+
uses: irongut/CodeCoverageSummary@v1.3.0
83+
if: ${{ github.event_name == 'pull_request' }}
7884
with:
7985
filename: ./coverage/coverage.xml
8086
badge: true
8187
fail_below_min: true
8288
format: markdown
83-
hide_branch_rate: true
89+
hide_branch_rate: false
8490
hide_complexity: true
8591
indicators: true
8692
output: both
87-
thresholds: '100 95'
93+
thresholds: '100 100'
8894
continue-on-error: ${{ matrix.experimental != 'false' }}
8995

9096
- name: Add Coverage PR Comment
9197
uses: marocchino/sticky-pull-request-comment@v2
92-
if: matrix.ruby == '2.7' && always()
98+
if: ${{ github.event_name == 'pull_request' }}
9399
with:
94100
recreate: true
95101
path: code-coverage-results.md
96102
continue-on-error: ${{ matrix.experimental != 'false' }}
97103

98-
- name: Coveralls
104+
- name: Upload coverage to Coveralls
99105
uses: coverallsapp/github-action@master
100-
if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
101106
with:
102107
github-token: ${{ secrets.GITHUB_TOKEN }}
103108
continue-on-error: ${{ matrix.experimental != 'false' }}
104109

105-
# Using the codecov gem instead.
106-
# - name: CodeCov
107-
# uses: codecov/codecov-action@v2
108-
# if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
109-
# with:
110-
# files: ./coverage/coverage.xml
111-
# flags: unittests
112-
# name: codecov-upload
113-
# fail_ci_if_error: true
114-
# continue-on-error: ${{ matrix.experimental != 'false' }}
110+
- name: Upload coverage to QLTY
111+
uses: qltysh/qlty-action/coverage@main
112+
with:
113+
coverage-token: ${{secrets.QLTY_COVERAGE_TOKEN}}
114+
files: coverage/.resultset.json
115+
continue-on-error: ${{ matrix.experimental != 'false' }}
116+
117+
- name: Upload coverage to CodeCov
118+
uses: codecov/codecov-action@v5
119+
with:
120+
fail_ci_if_error: true # optional (default = false)
121+
token: ${{ secrets.CODECOV_TOKEN }}
122+
verbose: true # optional (default = false)

.github/workflows/current.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Targets the evergreen latest release of ruby, truffleruby, and jruby
2+
name: Current
3+
4+
env:
5+
K_SOUP_COV_DO: false
6+
7+
on:
8+
push:
9+
branches:
10+
- 'main'
11+
- '*-stable'
12+
tags:
13+
- '!*' # Do not execute on tags
14+
pull_request:
15+
branches:
16+
- '*'
17+
# Allow manually triggering the workflow.
18+
workflow_dispatch:
19+
20+
permissions:
21+
contents: read
22+
23+
# Cancels all previous workflow runs for the same branch that have not yet completed.
24+
concurrency:
25+
# The concurrency group contains the workflow name and the branch name.
26+
group: "${{ github.workflow }}-${{ github.ref }}"
27+
cancel-in-progress: true
28+
29+
jobs:
30+
test:
31+
name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }}
32+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
33+
runs-on: ubuntu-latest
34+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
35+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
36+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
37+
strategy:
38+
matrix:
39+
include:
40+
# Ruby 3.4
41+
- ruby: "ruby"
42+
appraisal: "current"
43+
exec_cmd: "rake test"
44+
gemfile: "Appraisal.root"
45+
rubygems: latest
46+
bundler: latest
47+
48+
# truffleruby-24.1
49+
# (according to documentation: targets Ruby 3.3 compatibility)
50+
# (according to runtime: targets Ruby 3.2 compatibility)
51+
- ruby: "truffleruby"
52+
appraisal: "current"
53+
exec_cmd: "rake test"
54+
gemfile: "Appraisal.root"
55+
rubygems: default
56+
bundler: default
57+
58+
# jruby-10.0 (targets Ruby 3.4 compatibility)
59+
- ruby: "jruby"
60+
appraisal: "current"
61+
exec_cmd: "rake test"
62+
gemfile: "Appraisal.root"
63+
rubygems: default
64+
bundler: default
65+
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
- name: Setup Ruby & RubyGems
71+
uses: ruby/setup-ruby@v1
72+
with:
73+
ruby-version: ${{ matrix.ruby }}
74+
rubygems: ${{ matrix.rubygems }}
75+
bundler: ${{ matrix.bundler }}
76+
bundler-cache: false
77+
78+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
79+
# We need to do this first to get appraisal installed.
80+
# NOTE: This does not use the primary Gemfile at all.
81+
- name: Install Root Appraisal
82+
run: bundle
83+
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
84+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
85+
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
86+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/danger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
gemfile:
20-
- f2
20+
- vanilla
2121
rubygems:
2222
- latest
2323
bundler:
2424
- latest
2525
ruby:
26-
- "2.7"
26+
- "ruby"
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@v3
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
4+
#
5+
# Source repository: https://github.com/actions/dependency-review-action
6+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
7+
name: 'Dependency Review'
8+
on: [pull_request]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
dependency-review:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: 'Checkout Repository'
18+
uses: actions/checkout@v4
19+
- name: 'Dependency Review'
20+
uses: actions/dependency-review-action@v4

0 commit comments

Comments
 (0)