Skip to content

Commit

Permalink
feat: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dancixx committed Oct 23, 2024
1 parent 240aefd commit 5be300f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 62 deletions.
2 changes: 0 additions & 2 deletions .github/actions-rs/grcov.yml

This file was deleted.

59 changes: 37 additions & 22 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,46 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
override: true
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test
# env:
# CARGO_INCREMENTAL: "0"
# RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
# RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
- name: rust-grcov
# You may pin to the exact commit or the version.
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248
uses: actions-rs/[email protected]
- name: Codecov
# You may pin to the exact commit or the version.
# uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
uses: codecov/codecov-action@v4
components: llvm-tools-preview

- name: Add llvm-tools to PATH
run: echo "${HOME}/.rustup/toolchains/$(rustup show active-toolchain | cut -d' ' -f1)/bin" >> $GITHUB_PATH

- name: Install grcov
run: cargo install grcov

- name: Clean Build Artifacts
run: cargo clean

- name: Run tests with coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-C instrument-coverage -C codegen-units=1 -C debuginfo=0"
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
run: |
cargo test --all --verbose
- name: Generate coverage report
run: |
grcov . \
--binary-path ./target/debug/ \
-s . \
-t lcov \
--branch \
--ignore-not-existing \
--llvm \
-o lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
# Repository upload token - get it from codecov.io. Required only for private repositories
# token: # optional
# Specify whether the Codecov output should be verbose
verbose: true
files: lcov.info
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

0 comments on commit 5be300f

Please sign in to comment.