Skip to content

Commit bab4713

Browse files
authored
fix(general): coverage report (#222)
* fix: coverage report * fix coverage workflow
1 parent bca5e43 commit bab4713

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

.github/workflows/generate-allure-report.yml

+15-27
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
env:
16-
ALLURE_REPORT_PATH: allure-report
17-
COVERAGE_REPORT_PATH: coverage-report
16+
ALLURE_REPORT_FOLDER: allure-report
17+
COVERAGE_REPORT_FOLDER: coverage-report
1818
REPORT_EXT: .junit-report.xml
19-
COVERAGE_EXT: .info
19+
COVERAGE_EXT: .coverage.info
20+
REPO_BASE_PATH: catalyst-libs/
21+
2022

2123
jobs:
2224
generate-test-reports:
@@ -73,10 +75,10 @@ jobs:
7375

7476
- name: Setup Allure report
7577
run: |
76-
mkdir -p ${{ env.ALLURE_REPORT_PATH }}
78+
mkdir -p ${{ env.ALLURE_REPORT_FOLDER }}
7779
shopt -s globstar
78-
cp **/*${{ env.REPORT_EXT }} ${{ env.ALLURE_REPORT_PATH }}
79-
ls ${{ env.ALLURE_REPORT_PATH }}
80+
cp **/*${{ env.REPORT_EXT }} ${{ env.ALLURE_REPORT_FOLDER }}
81+
ls ${{ env.ALLURE_REPORT_FOLDER }}
8082
8183
- name: Checkout gh-pages
8284
uses: actions/checkout@v4
@@ -90,7 +92,7 @@ jobs:
9092
with:
9193
report_id: "test-report"
9294
gh_pages: "gh-pages-dir"
93-
report_dir: ${{ env.ALLURE_REPORT_PATH }}
95+
report_dir: ${{ env.ALLURE_REPORT_FOLDER }}
9496

9597
- name: Git push to gh-pages
9698
uses: mgrybyk/git-commit-pull-push-action@v1
@@ -105,7 +107,7 @@ jobs:
105107
with:
106108
message: |
107109
${{ 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 }}}$ |
108-
mode: upsert
110+
comment-tag: test_report
109111

110112
generate-coverage-report:
111113
name: Generate coverage report
@@ -120,35 +122,21 @@ jobs:
120122

121123
- name: Collect coverage report
122124
run: |
123-
mkdir -p ${{ env.COVERAGE_REPORT_PATH }}
125+
mkdir -p ${{ env.COVERAGE_REPORT_FOLDER }}
124126
shopt -s globstar
125-
cp **/*${{ env.COVERAGE_EXT }} ${{ env.COVERAGE_REPORT_PATH }}
126-
ls ${{ env.COVERAGE_REPORT_PATH }}
127+
cp **/*${{ env.COVERAGE_EXT }} ${{ env.COVERAGE_REPORT_FOLDER }}
128+
ls ${{ env.COVERAGE_REPORT_FOLDER }}
127129
128130
- name: Normalize coverage report paths
129131
run: |
130-
sed -i -e 's/SF:\/root\/build/SF:rust/g' ${{ env.COVERAGE_REPORT_PATH }}/cat-libs.coverage.info
132+
sed -i -e 's/SF:\/root\/build/SF:rust/g' ${{ env.COVERAGE_REPORT_FOLDER }}/cat-libs${{ env.COVERAGE_EXT }}
131133
132134
- name: Coveralls
133135
env:
134136
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135137
uses: coverallsapp/github-action@v2
136138
with:
137-
path-to-lcov: "${{ env.COVERAGE_REPORT_PATH }}/cat-libs.coverage.info"
139+
path-to-lcov: "${{ env.COVERAGE_REPORT_FOLDER }}/cat-libs${{ env.COVERAGE_EXT }}"
138140
allow-empty: true
139141
debug: true
140142
flag-name: rust-unit-test
141-
base-path: "/home/runner/work/catalyst-libs/catalyst-libs/"
142-
parallel: true
143-
144-
upload-coverage-report:
145-
name: Upload coverage report
146-
needs: [generate-coverage-report]
147-
if: ${{ always() }}
148-
runs-on: ubuntu-latest
149-
steps:
150-
- name: Coveralls Finished
151-
uses: coverallsapp/github-action@v2
152-
with:
153-
parallel-finished: true
154-
carryforward: "rust-unit-test"

0 commit comments

Comments
 (0)