|
59 | 59 | if-no-files-found: error |
60 | 60 | retention-days: 1 |
61 | 61 |
|
| 62 | + - name: Collect and upload test coverage |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + if: always() |
| 65 | + with: |
| 66 | + name: coverage-reports |
| 67 | + path: "**/*${{ env.COVERAGE_EXT }}" |
| 68 | + if-no-files-found: error |
| 69 | + retention-days: 1 |
| 70 | + |
62 | 71 | generate-allure-report: |
63 | 72 | name: Generate allure report |
64 | 73 | runs-on: ubuntu-latest |
@@ -106,3 +115,49 @@ jobs: |
106 | 115 | ${{ steps.allure.outputs.test_result_icon }} [Test Report](${{ steps.allure.outputs.report_url }}) | ${\color{lightgreen}Pass: ${{ steps.allure.outputs.test_result_passed }}/${{ steps.allure.outputs.test_result_total }}}$ | ${\color{red}Fail: ${{ steps.allure.outputs.test_result_failed }}/${{ steps.allure.outputs.test_result_total }}}$ | |
107 | 116 | comment_tag: allure_report |
108 | 117 | mode: upsert |
| 118 | + |
| 119 | + generate-coverage-report: |
| 120 | + name: Generate coverage report |
| 121 | + runs-on: ubuntu-latest |
| 122 | + needs: [generate-test-reports] |
| 123 | + steps: |
| 124 | + - uses: actions/checkout@v4 |
| 125 | + |
| 126 | + - uses: actions/download-artifact@v4 |
| 127 | + with: |
| 128 | + name: coverage-reports |
| 129 | + |
| 130 | + - name: Collect coverage report |
| 131 | + run: | |
| 132 | + mkdir -p ${{ env.COVERAGE_REPORT_PATH }} |
| 133 | + shopt -s globstar |
| 134 | + cp **/*${{ env.COVERAGE_EXT }} ${{ env.COVERAGE_REPORT_PATH }} |
| 135 | + ls ${{ env.COVERAGE_REPORT_PATH }} |
| 136 | +
|
| 137 | + - name: Normalize coverage report paths |
| 138 | + run: | |
| 139 | + sed -i -e 's/SF:\/root\/build/SF:rust/g' ${{ env.COVERAGE_REPORT_PATH }}/cat-libs.coverage.info |
| 140 | +
|
| 141 | + - name: Coveralls |
| 142 | + env: |
| 143 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 144 | + uses: coverallsapp/github-action@v2 |
| 145 | + with: |
| 146 | + path-to-lcov: "${{ env.COVERAGE_REPORT_PATH }}/cat-libs.coverage.info" |
| 147 | + allow-empty: true |
| 148 | + debug: true |
| 149 | + flag-name: rust-unit-test |
| 150 | + base-path: "/home/runner/work/catalyst-libs/catalyst-libs/" |
| 151 | + parallel: true |
| 152 | + |
| 153 | + upload-coverage-report: |
| 154 | + name: Upload coverage report |
| 155 | + needs: [generate-coverage-report] |
| 156 | + if: ${{ always() }} |
| 157 | + runs-on: ubuntu-latest |
| 158 | + steps: |
| 159 | + - name: Coveralls Finished |
| 160 | + uses: coverallsapp/github-action@v2 |
| 161 | + with: |
| 162 | + parallel-finished: true |
| 163 | + carryforward: "rust-unit-test" |
0 commit comments