Finish 0.6.0 #245
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'crates/**' | |
- 'xbuild-tests/**' | |
- '.github/workflows/rust.yml' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'crates/**' | |
- 'xbuild-tests/**' | |
- '.github/workflows/rust.yml' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check format | |
run: cargo fmt --check | |
- name: Clippy | |
run: cargo clippy | |
docs: | |
name: Build documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build documentation | |
run: cargo doc | |
codecov: | |
needs: lint | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --verbose | |
- name: Build Benchmarks | |
run: cargo build --benches --package minikalman | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools-preview | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: Generate code coverage | |
run: cargo llvm-cov nextest --features=std,fixed,alloc,unsafe,nalgebra --workspace --exclude stm32 --lcov --output-path lcov.info | |
- name: Test using libm | |
run: cargo nextest run --no-default-features --features=libm,alloc | |
- name: Test using micromath | |
run: cargo nextest run --no-default-features --features=micromath,alloc | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: lcov.info | |
fail_ci_if_error: true | |
build-std: | |
needs: | |
- lint | |
- docs | |
name: Build and Test (floating-point) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/install-action@nextest | |
- name: Run Example (float) | |
run: cargo run --example=gravity --no-default-features --features=std | |
- name: Run EKF example | |
run: cargo run --example=radar-2d --no-default-features --features=std | |
- name: Run tests (std) | |
run: cargo nextest run --verbose --package minikalman --no-default-features --features=std | |
- name: Run tests (libm) | |
run: cargo nextest run --verbose --package minikalman --no-default-features --features=libm,alloc | |
- name: Run doctests | |
run: cargo test --doc --verbose --package minikalman --no-default-features --features=std | |
- name: Run doctests (libm) | |
run: cargo test --doc --verbose --package minikalman --no-default-features --features=std | |
build-fixed: | |
needs: | |
- lint | |
- docs | |
name: Build and Test (fixed-point) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/install-action@nextest | |
- name: Run Example (fixed) | |
run: cargo run --example=fixed --no-default-features --features=fixed,std | |
- name: Run tests (fixed) | |
run: cargo nextest run --verbose --package minikalman --no-default-features --features=fixed,std | |
- name: Run doctests (fixed) | |
run: cargo test --doc --verbose --package minikalman --no-default-features --features=fixed,std | |
build-others: | |
needs: | |
- codecov | |
- build-std | |
- build-fixed | |
name: Build and Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/install-action@nextest | |
- name: Run tests | |
run: cargo nextest run --package minikalman --verbose | |
- name: Run doctests | |
run: cargo test --doc --package minikalman --verbose |