Skip to content

Commit d24b883

Browse files
committed
ci: fix coverage evaluation
1 parent d4ff370 commit d24b883

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/linux.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Install Dependencies
29-
run: sudo apt-get update; sudo apt-get install libarchive-dev protobuf-compiler socat
29+
run: sudo apt-get update; sudo apt-get install libarchive-dev protobuf-compiler socat; rustup component add llvm-tools-preview
3030
- name: Checkout sources
3131
uses: actions/checkout@v2
3232
- name: Install ${{ matrix.version }}
@@ -119,20 +119,25 @@ jobs:
119119
args: --locked --all --all-features --no-fail-fast -- --nocapture
120120
env:
121121
CARGO_INCREMENTAL: '0'
122-
RUSTFLAGS: '-Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'
123-
- id: coverage
122+
RUSTFLAGS: '-Cinstrument-coverage'
123+
LLVM_PROFILE_FILE: 'target/coverage/%p-%m.profraw'
124+
125+
- name: Generate coverage report
124126
if: matrix.name == 'nightly'
125-
uses: actions-rs/grcov@master
127+
run: |
128+
grcov target/coverage/ --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "tests/*" -o target/coverage/lcov.info
129+
126130
- name: Coveralls upload
127131
if: matrix.name == 'nightly'
128132
uses: coverallsapp/github-action@master
129133
with:
130134
github-token: ${{ secrets.GITHUB_TOKEN }}
131-
path-to-lcov: ${{ steps.coverage.outputs.report }}
135+
format: lcov
136+
path-to-lcov: target/coverage/lcov.info
132137
- name: Clear the coverage files from cache
133138
if: matrix.name == 'nightly'
134139
run: |
135-
find target/ -name "*.gcda" -exec rm {} +
140+
find target/coverage/ -name "*.profraw" -exec rm {} +
136141
137142
- name: Clear the cargo caches
138143
run: |

0 commit comments

Comments
 (0)