name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup component add clippy rustfmt
- run: cargo fmt --check
- run: cargo clippy -- -D warnings
- run: cargo test
- run: cargo test --features color
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Generate coverage
run: cargo tarpaulin --engine llvm --out lcov --output-dir ./coverage
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
file: ./coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}