Skip to content

chore: Improve unit tests with built-in containers support #83

chore: Improve unit tests with built-in containers support

chore: Improve unit tests with built-in containers support #83

Workflow file for this run

name: Code coverage report
on:
pull_request:
push:
branches:
- main
- rel-v*
env:
CARGO_TERM_COLOR: always
jobs:
codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Setup for testing
run: |
mkdir grcov
curl -sL https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | (cd grcov ; tar jxf -)
rustup toolchain add nightly --component llvm-tools-preview
rustup override set nightly
- name: Test
env:
CI: true
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: git-events-runner-%p-%m.profraw
RUST_LOG: debug
run: cargo test --all -- --include-ignored --nocapture
- name: Generate coverage
run: |
grcov/grcov $(find . -name "git-events-runner-*.profraw" -print) \
--branch \
--ignore-not-existing \
--binary-path ./target/debug/ \
-s src \
-t lcov \
--ignore "/*" \
--excl-line '^\s*\.await\??;?$' --excl-br-line '^\s*\.await\??;?$' \
-o lcov.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
file: ./lcov.info