Skip to content

Rust CI

Rust CI #5708

Workflow file for this run

name: Rust CI
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 */6 * * *"
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
rust:
- stable
- nightly
steps:
- uses: actions/checkout@v4
- name: Update local toolchain
run: rustup update
- name: rustup install (nightly)
if: ${{ matrix.rust == 'nightly' }}
run: |
rustup install nightly
rustup default nightly
rustup component add clippy rustfmt
- name: rustup install (stable)
if: ${{ matrix.rust == 'stable' }}
run: |
rustup install stable
rustup default stable
rustup component add clippy rustfmt
- name: Toolchain info
run: |
cargo --version --verbose
rustc --version
cargo clippy --version
- name: Run tests
run: cargo test --verbose
- name: Run tests (without default features)
run: cargo test --manifest-path k9/Cargo.toml --no-default-features --verbose
- name: Run tests for custom_comparison_formatters (nightly only)
run: cargo test --manifest-path k9/Cargo.toml --features custom_comparison_formatters
if: ${{ matrix.rust == 'nightly' }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Lint
run: cargo clippy -- -D warnings