Skip to content

Commit aa7a4aa

Browse files
committed
ci: simplify test converage generation
1 parent 6bbf548 commit aa7a4aa

1 file changed

Lines changed: 14 additions & 40 deletions

File tree

.github/workflows/linux.yml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,17 @@ 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 -y; sudo apt-get install -y libarchive-dev libclang-dev protobuf-compiler socat
30+
3031
- name: Checkout sources
31-
uses: actions/checkout@v2
32+
uses: actions/checkout@v4
33+
3234
- name: Install ${{ matrix.version }}
3335
uses: actions-rs/toolchain@v1
3436
with:
3537
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
3638
profile: minimal
3739
override: true
38-
- name: Install grcov tool
39-
if: matrix.name == 'nightly'
40-
uses: actions-rs/install@v0.1
41-
with:
42-
crate: grcov
43-
use-tool-cache: true
44-
45-
- name: Install cargo bloat tool
46-
if: matrix.name == 'MSRV' && 0
47-
uses: actions-rs/install@v0.1
48-
with:
49-
crate: cargo-bloat
50-
use-tool-cache: true
5140

5241
- name: Install cargo tree tool
5342
if: matrix.name == 'MSRV'
@@ -104,37 +93,22 @@ jobs:
10493
exit 4
10594
fi
10695
107-
- name: Run cargo bloat
108-
if: matrix.name == 'MSRV' && 0
109-
uses: orf/cargo-bloat-action@v1
110-
with:
111-
token: ${{ secrets.GITHUB_TOKEN }}
112-
bloat_args: --release --package updatehub
113-
114-
- name: Run cargo test with coverage
96+
- name: Install cargo-llvm-cov
11597
if: matrix.name == 'nightly'
116-
uses: actions-rs/cargo@v1
117-
with:
118-
command: test
119-
args: --locked --all --all-features --no-fail-fast -- --nocapture
120-
env:
121-
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
98+
uses: taiki-e/install-action@cargo-llvm-cov
99+
100+
- name: Generate code coverage
124101
if: matrix.name == 'nightly'
125-
uses: actions-rs/grcov@master
126-
- name: Coveralls upload
102+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
103+
104+
- name: Upload coverage to Coveralls
127105
if: matrix.name == 'nightly'
128-
uses: coverallsapp/github-action@master
106+
uses: coverallsapp/github-action@v2
129107
with:
130108
github-token: ${{ secrets.GITHUB_TOKEN }}
131-
path-to-lcov: ${{ steps.coverage.outputs.report }}
132-
- name: Clear the coverage files from cache
133-
if: matrix.name == 'nightly'
134-
run: |
135-
find target/ -name "*.gcda" -exec rm {} +
109+
path-to-lcov: lcov.info
136110

137111
- name: Clear the cargo caches
138112
run: |
139-
cargo +stable install cargo-cache --no-default-features --features ci-autoclean
113+
cargo install cargo-cache --no-default-features --features ci-autoclean
140114
cargo-cache

0 commit comments

Comments
 (0)