@@ -19,6 +19,16 @@ inputs:
1919 required : false
2020 type : boolean
2121 default : false
22+ coverage :
23+ description : Enforce test coverage
24+ required : false
25+ type : boolean
26+ default : false
27+ minimum_coverage :
28+ description : Minimum test coverage
29+ required : false
30+ type : string
31+ default : 85
2232 build :
2333 description : Build gem
2434 required : false
7484 # ...but not for appraisals, sadly.
7585 - name : Install Ruby ${{ inputs.ruby }} with dependencies
7686 if : " ${{ steps.setup.outputs.appraisals == 'false' }}"
77- uses : ruby/setup-ruby@v1.213 .0
87+ uses : ruby/setup-ruby@v1.214 .0
7888 with :
7989 ruby-version : " ${{ inputs.ruby }}"
8090 working-directory : " ${{ steps.setup.outputs.gem_dir }}"
8595 # If we're using appraisals, do it all manually.
8696 - name : Install Ruby ${{ inputs.ruby }} without dependencies
8797 if : " ${{ steps.setup.outputs.appraisals == 'true' }}"
88- uses : ruby/setup-ruby@v1.213 .0
98+ uses : ruby/setup-ruby@v1.214 .0
8999 with :
90100 ruby-version : " ${{ inputs.ruby }}"
91101 bundler : " latest"
@@ -161,6 +171,14 @@ runs:
161171 bundle exec rake rubocop
162172 working-directory : " ${{ steps.setup.outputs.gem_dir }}"
163173
174+ - name : Coverage
175+ shell : bash
176+ if : " ${{ inputs.coverage == 'true' }}"
177+ # This starts a new simplecov run which tracks nothing of its own,
178+ # but merges with the existing coverage reports generated during testing.
179+ run : ' bundle exec ruby -e '' require "simplecov"; SimpleCov.minimum_coverage(${{ inputs.minimum_coverage }})'' '
180+ working-directory : " ${{ steps.setup.outputs.gem_dir }}"
181+
164182 - name : Build Gem
165183 shell : bash
166184 if : " ${{ inputs.build == 'true' }}"
0 commit comments