name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets -- -D clippy::correctness
- name: Test
run: cargo test
- name: Semver check
if: github.event_name == 'pull_request'
run: |
cargo install cargo-semver-checks --locked || true
cargo semver-checks