on:
push:
branches:
- master
paths:
- ".github/workflows/tests.yml"
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
pull_request:
branches:
- master
paths:
- ".github/workflows/tests.yml"
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
name: 🧪 Rust Testing and coverage
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-homography-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-homography-
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install llvm-cov
run: cargo install cargo-llvm-cov
- name: Run cargo-llvm-cov
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: --cobertura --output-path "cobertura.xml"
env:
CARGO_INCREMENTAL: 0
- name: Upload to codecov.io
uses: codecov/codecov-action@v4.0.1
with:
token: ${{secrets.CODECOV_TOKEN}}