name: UT
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: cargo, llvm-tools-preview
override: true
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Cache dependencies
uses: actions/cache@v2
env:
cache-name: cache-cargo-dependencies
with:
path: |
~/.cargo/.crates2.json
~/.cargo/.crates.toml
~/.cargo/registry/
~/.cargo/git/
~/.cargo/bin/
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Run test
env:
RUST_BACKTRACE: full
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload to CodeCov
uses: codecov/codecov-action@v3
with:
files: *.info
fail_ci_if_error: true