Skip to content

test(add): add some test case to test codecov #21

test(add): add some test case to test codecov

test(add): add some test case to test codecov #21

Workflow file for this run

on:
push:
branches: [main]
name: main
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
env:
RUSTFLAGS: -Cinstrument-coverage
run: cargo build
- name: Test
env:
LLVM_PROFILE_FILE: grcov-%p-%m.profraw
RUSTFLAGS: -Cinstrument-coverage
run: cargo test
- name: Generate coverage
run: |
cargo install grcov
grcov $(find . -name "grcov-*.profraw" -print) \
--branch \
--ignore-not-existing \
--binary-path ./target/debug/ \
-s . \
-t lcov \
--ignore "/*" \
-o lcov.info
- name: Upload to CodeCov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov.info
fail_ci_if_error: true