name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run Rustfmt
run: cargo fmt -- --check
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
- name: Build
run: cargo build --verbose
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo llvm-cov --codecov --output-path ./lcov.txt
- name: Upload coverage to Codecov
uses: Wandalen/wretry.action@master
with:
action: codecov/codecov-action@v3
attempt_limit: 6
attempt_delay: 10000
with: |
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov.txt
verbose: true