name: Testing
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
test-rust:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v4
- name: Run Clippy
run: cargo clippy --all-targets --all-features
- name: Run Tests
run: cargo test --verbose
coverage:
name: coverage
needs: [test-rust]
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate code coverage
run: |
cargo tarpaulin --verbose --all-features --workspace --timeout 1200 --out xml --engine llvm --rustflags="-C opt-level=0"
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}