name: Test
on:
workflow_call:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
check:
uses: ./.github/workflows/check.yml
test:
needs: check
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests and generate code coverage
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --verbose --workspace --timeout 120 --out xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true