Add & fix CI (#60)

This commit is contained in:
Jean-Philippe Bossuat
2025-08-08 19:59:29 +02:00
committed by GitHub
parent 5d0d545f6a
commit 4c59733566
3 changed files with 25 additions and 49 deletions

View File

@@ -2,62 +2,36 @@ name: CI
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_TERM_COLOR: always
branches: [ main ]
jobs:
build-and-test:
name: Build & Test (stable, beta, nightly)
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install toolchain
uses: actions/setup-rust@v1
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Cargo fmt check
run: cargo fmt --all -- --check
- name: Build
run: cargo build --all-targets
- name: Build
run: cargo build --all-targets --verbose
- name: Run tests
run: cargo test --all-targets --verbose
- name: Run Clippy
run: cargo clippy --all-targets -- -D warnings
docs:
name: Check Documentation
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-rust@v1
with:
toolchain: stable
- name: Build docs
run: cargo doc --all --no-deps --verbose
- name: Run tests
run: cargo test --all