1414# see https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
1515permissions : {}
1616
17+ concurrency :
18+ group : ' ${{ github.workflow }}-${{ github.ref }}'
19+ cancel-in-progress : true
20+
21+ env :
22+ COVERAGE_DIR : coverage
23+ TESTS_COVERAGE_ARTIFACT : coverage
24+
1725jobs :
1826 test :
1927 name : Ruby ${{ matrix.ruby }}
3947 bundler-cache : true
4048 - name : Run the default task
4149 run : bundle exec rake
50+ - name : Artifact coverage
51+ if : ${{ ! cancelled() }}
52+ # see https://github.com/actions/upload-artifact
53+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
54+ with :
55+ name : ' ${{ env.TESTS_COVERAGE_ARTIFACT }}_ruby${{ matrix.ruby }}'
56+ path : ${{ env.COVERAGE_DIR }}
57+ if-no-files-found : error
58+ retention-days : 7
59+ report-coverage :
60+ name : Publish test coverage
61+ needs : [ "test" ]
62+ runs-on : ubuntu-latest
63+ timeout-minutes : 5
64+ steps :
65+ - name : fetch test artifacts
66+ # see https://github.com/actions/download-artifact
67+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
68+ with :
69+ pattern : ' ${{ env.TESTS_COVERAGE_ARTIFACT }}_*'
70+ merge-multiple : false
71+ path : ${{ env.COVERAGE_DIR }}
72+ - run : |
73+ ls -lisah "$COVERAGE_DIR"
74+ tree "$COVERAGE_DIR"
75+ dhjsakdhsad # debug break
76+ - name : Run codacy-coverage-reporter
77+ env :
78+ CODACY_PROJECT_TOKEN : ${{ secrets.CODACY_PROJECT_TOKEN }}
79+ # # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-secrets
80+ if : ${{ env.CODACY_PROJECT_TOKEN != '' }}
81+ # see https://github.com/codacy/codacy-coverage-reporter-action
82+ uses : codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1
83+ with :
84+ project-token : ${{ env.CODACY_PROJECT_TOKEN }}
85+ coverage-reports : ${{ env.COVERAGE_DIR }}/**/coverage.xml
0 commit comments