chore: ci #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
concurrency: | |
group: ${{github.workflow}}-${{github.ref}} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
fmt: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fmt check | |
run: cargo fmt --check | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check | |
run: cargo check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run clippy | |
run: cargo clippy --no-deps --all-targets | |
tests: | |
name: Unit and Integration Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build | |
- name: Run tests | |
run: cargo test | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache cargo output | |
uses: Swatinem/rust-cache@v2 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate coverage report | |
id: codecov | |
run: | | |
cargo llvm-cov clean --workspace | |
cargo llvm-cov test | |
new_cov=$(cargo llvm-cov test) | |
new_cov="${new_cov//'%'/'%25'}" | |
new_cov="${new_cov//$'\n'/'%0A'}" | |
new_cov="${new_cov//$'\r'/'%0D'}" | |
echo "::set-output name=new_cov_comment::$new_cov" | |
- name: Add PR comment | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message: | | |
**Current test coverage** | |
``` | |
${{ steps.codecov.outputs.new_cov_comment }} | |
``` |