Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: store HTML coverage report #1

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 35 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,47 @@ jobs:
runs-on: ubuntu-latest
#container:
# image: centos8

steps:
- uses: dtolnay/rust-toolchain@1.69.0
- uses: actions/checkout@v3
- name: Preparing
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
override: true
- name: Installing dependency packages
run: sudo apt update && sudo apt install -y libxen-dev protobuf-compiler

- name: Build
run: cargo build --verbose

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --codecov --output-path cov.json

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: cov.json
fail_ci_if_error: true

toolchain: nightly
override: true
- name: Installing dependency packages
run: sudo apt update && sudo apt install -y libxen-dev protobuf-compiler

- name: Run tests
run: cargo test --verbose
run: |
cargo clean
cargo test --verbose
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: Install grcov
run: cargo install grcov
- name: Test coverage report
run: grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/

- name: Upload test coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-html
path: ./target/debug/coverage/
Loading