File tree Expand file tree Collapse file tree 2 files changed +28
-6
lines changed
actions/upload-test-coverage Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 1+ name : " Upload test coverage file"
2+ description : " Upload test coverage file to the desired location"
3+ outputs :
4+ coverage-value :
5+ description : " coverage value"
6+ value : ${{ steps.coverage-value-getter.outputs.coverage-value }}
7+ runs :
8+ using : " composite"
9+ steps :
10+ - name : " Archive code coverage results"
11+ uses : actions/upload-artifact@v3
12+ with :
13+ name : code-coverage-report
14+ path : coverage
15+
16+ - name : " Get coverage value"
17+ id : coverage-value-getter
18+ run : |
19+ coverage_value=`cat ./coverage/.last_run.json | jq -r .result.line`
20+ echo "coverage-value=$coverage_value" >> "$GITHUB_OUTPUT"
21+ shell : bash
Original file line number Diff line number Diff line change @@ -30,12 +30,13 @@ jobs:
3030 run : bundle exec rubocop
3131 - name : Run RSpec
3232 run : bundle exec rspec
33- # https://docs.github.com/ja/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts
34- - name : Archive code coverage results
35- uses : actions/upload-artifact@v2
36- with :
37- name : code-coverage-report
38- path : coverage
33+ - name : Upload test coverage
34+ id : upload-test-coverage
35+ uses : ./.github/actions/upload-test-coverage
36+ - name : Display test coverage in summary
37+ run : |
38+ coverage_value=${{ steps.upload-test-coverage.outputs.coverage-value }}
39+ echo "# Coverage report: $coverage_value%" >> $GITHUB_STEP_SUMMARY
3940 # https://github.com/marketplace/actions/action-slack
4041 - name : Github Actions notify to Slack
4142 uses : 8398a7/action-slack@v3
You can’t perform that action at this time.
0 commit comments