name: Cargo Build & Test
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
features:
- default
- humantime
- bytesize
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: |
case "${{ matrix.features }}" in
default)
cargo build --verbose
cargo test --verbose
;;
humantime)
cargo build --no-default-features --features humantime --verbose
cargo test --no-default-features --features humantime --verbose
;;
bytesize)
cargo build --no-default-features --features bytesize --verbose
cargo test --no-default-features --features bytesize --verbose
;;
esac
- run: cargo doc --verbose
- run: cargo clippy --verbose
if: matrix.toolchain == 'stable'