1- name : Ruby - Coverage
1+ name : Test Coverage
22
33env :
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
810on :
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
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 }}
0 commit comments