11name : Test Coverage
22
3+ permissions :
4+ contents : read
5+ pull-requests : write
6+ id-token : write
7+
38env :
4- K_SOUP_COV_MIN_BRANCH : 79
5- K_SOUP_COV_MIN_LINE : 92
9+ K_SOUP_COV_MIN_BRANCH : 76
10+ K_SOUP_COV_MIN_LINE : 90
611 K_SOUP_COV_MIN_HARD : true
7- K_SOUP_COV_FORMATTERS : " html,rcov,lcov,json,tty"
12+ K_SOUP_COV_FORMATTERS : " html,xml, rcov,lcov,json,tty"
813 K_SOUP_COV_DO : true
914 K_SOUP_COV_MULTI_FORMATTERS : true
1015 K_SOUP_COV_COMMAND_NAME : " RSpec Coverage"
2126 # Allow manually triggering the workflow.
2227 workflow_dispatch :
2328
24- permissions :
25- contents : read
26-
2729# Cancels all previous workflow runs for the same branch that have not yet completed.
2830concurrency :
2931 # The concurrency group contains the workflow name and the branch name.
4446 include :
4547 # Coverage
4648 - ruby : " ruby"
47- appraisal : " coverage"
49+ appraisal_name : " coverage"
4850 exec_cmd : " rake spec:orm:all"
4951 gemfile : " Appraisal.root"
5052 rubygems : latest
@@ -82,14 +84,38 @@ jobs:
8284
8385 # Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
8486 # We need to do this first to get appraisal installed.
85- # NOTE: This does not use the main Gemfile at all.
87+ # NOTE: This does not use the primary Gemfile at all.
8688 - name : Install Root Appraisal
8789 run : bundle
88- - name : Appraisal for ${{ matrix.appraisal }}
89- run : bundle exec appraisal ${{ matrix.appraisal }} bundle
90- - name : Tests for ${{ matrix.ruby }}@current via ${{ matrix.exec_cmd }}
91- run : bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
90+ - name : Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
91+ run : bundle exec appraisal ${{ matrix.appraisal_name }} bundle
92+ - name : Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
93+ run : bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }}
9294
95+ # Do SaaS coverage uploads first
96+ - name : Upload coverage to Coveralls
97+ uses : coverallsapp/github-action@master
98+ with :
99+ github-token : ${{ secrets.GITHUB_TOKEN }}
100+ continue-on-error : ${{ matrix.experimental != 'false' }}
101+
102+ - name : Upload coverage to QLTY
103+ uses : qltysh/qlty-action/coverage@main
104+ with :
105+ token : ${{secrets.QLTY_COVERAGE_TOKEN}}
106+ files : coverage/.resultset.json
107+ continue-on-error : ${{ matrix.experimental != 'false' }}
108+
109+ # Build will fail here if coverage upload fails
110+ # which will hopefully be noticed for the lack of code coverage comments
111+ - name : Upload coverage to CodeCov
112+ uses : codecov/codecov-action@v5
113+ with :
114+ use_oidc : true
115+ fail_ci_if_error : true # optional (default = false)
116+ verbose : true # optional (default = false)
117+
118+ # Then PR comments
93119 - name : Code Coverage Summary Report
94120 uses : irongut/CodeCoverageSummary@v1.3.0
95121 if : ${{ github.event_name == 'pull_request' }}
@@ -102,7 +128,7 @@ jobs:
102128 hide_complexity : true
103129 indicators : true
104130 output : both
105- thresholds : ' 100 100 '
131+ thresholds : ' 90 76 '
106132 continue-on-error : ${{ matrix.experimental != 'false' }}
107133
108134 - name : Add Coverage PR Comment
@@ -112,16 +138,3 @@ jobs:
112138 recreate : true
113139 path : code-coverage-results.md
114140 continue-on-error : ${{ matrix.experimental != 'false' }}
115-
116- - name : Upload coverage to Coveralls
117- uses : coverallsapp/github-action@master
118- with :
119- github-token : ${{ secrets.GITHUB_TOKEN }}
120- continue-on-error : ${{ matrix.experimental != 'false' }}
121-
122- - name : Upload coverage to CodeCov
123- uses : codecov/codecov-action@v5
124- with :
125- fail_ci_if_error : true # optional (default = false)
126- token : ${{ secrets.CODECOV_TOKEN }}
127- verbose : true # optional (default = false)
0 commit comments