name: Tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions: {}
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Execute unit tests
runs-on: ubuntu-latest
permissions: {}
env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
steps:
- name: Set up shared compilation cache
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba - name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust LLVM tools preview
run: rustup component add llvm-tools-preview
- name: Install Rust coverage tool
uses: taiki-e/install-action@b20dedce73af6905cdc30d6611090c9b67557c8d with:
tool: cargo-llvm-cov
- name: Fetch Rust dependencies
run: cargo fetch
- name: Check formatting
run: cargo fmt --check
- name: Build
run: cargo build
- name: Run tests
run: |
cargo llvm-cov test --cobertura --verbose --output-path cobertura.xml
- name: Check for lint warnings with Clippy
run: cargo clippy
- name: Upload test coverage to Coveralls.io
with:
fail-on-error: false
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329