Skip to content

Commit 5be300f

Browse files
committed
feat: update ci
1 parent 240aefd commit 5be300f

File tree

3 files changed

+37
-62
lines changed

3 files changed

+37
-62
lines changed

.github/actions-rs/grcov.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/rust.yml

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,46 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v3
18+
1819
- uses: actions-rs/toolchain@v1
1920
with:
20-
toolchain: nightly
21+
toolchain: stable
2122
override: true
22-
- name: Build
23-
run: cargo build --verbose
24-
- name: Run tests
25-
run: cargo test
26-
# env:
27-
# CARGO_INCREMENTAL: "0"
28-
# RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
29-
# RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
30-
- name: rust-grcov
31-
# You may pin to the exact commit or the version.
32-
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248
33-
uses: actions-rs/[email protected]
34-
- name: Codecov
35-
# You may pin to the exact commit or the version.
36-
# uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
37-
uses: codecov/codecov-action@v4
23+
components: llvm-tools-preview
24+
25+
- name: Add llvm-tools to PATH
26+
run: echo "${HOME}/.rustup/toolchains/$(rustup show active-toolchain | cut -d' ' -f1)/bin" >> $GITHUB_PATH
27+
28+
- name: Install grcov
29+
run: cargo install grcov
30+
31+
- name: Clean Build Artifacts
32+
run: cargo clean
33+
34+
- name: Run tests with coverage
3835
env:
39-
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
36+
CARGO_INCREMENTAL: "0"
37+
RUSTFLAGS: "-C instrument-coverage -C codegen-units=1 -C debuginfo=0"
38+
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
39+
run: |
40+
cargo test --all --verbose
41+
42+
- name: Generate coverage report
43+
run: |
44+
grcov . \
45+
--binary-path ./target/debug/ \
46+
-s . \
47+
-t lcov \
48+
--branch \
49+
--ignore-not-existing \
50+
--llvm \
51+
-o lcov.info
52+
53+
- name: Upload coverage to Codecov
54+
uses: codecov/codecov-action@v4
4055
with:
41-
# Repository upload token - get it from codecov.io. Required only for private repositories
42-
# token: # optional
43-
# Specify whether the Codecov output should be verbose
44-
verbose: true
56+
files: lcov.info
4557
fail_ci_if_error: true
58+
verbose: true
59+
env:
60+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)