V3 #231
Workflow file for this run
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 CI | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
override: true | ||
- name: Cache Rust toolchain | ||
uses: actions/cache@v3 | ||
id: rust-toolchain | ||
with: | ||
paths: | ||
- $HOME/.cargo/ | ||
Check failure on line 29 in .github/workflows/rust.yaml
|
||
key: ${{ runner.os }}-rust-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-rust- | ||
- name: Check no default features | ||
run: cargo check --no-default-features | ||
- name: Check formatting | ||
run: cargo fmt -- --check | ||
- name: Lint with Clippy | ||
run: cargo clippy --workspace --all-features --bins --tests | ||
- name: Cache build artifacts | ||
uses: actions/cache@v3 | ||
id: build-cache | ||
with: | ||
paths: | ||
- target/ | ||
key: ${{ runner.os }}-build-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-build- | ||
- name: Build | ||
run: cargo build --release --workspace --all-features --verbose | ||
- name: Install Nextest | ||
run: cargo install nextest | ||
- name: Cache Nextest | ||
uses: actions/cache@v3 | ||
id: nextest-cache | ||
with: | ||
paths: | ||
- $HOME/.cargo/bin/nextest | ||
key: ${{ runner.os }}-nextest-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextest- | ||
- name: Run tests with Nextest | ||
run: cargo nextest run --all-features --workspace --verbose | ||
- name: Cache test results | ||
uses: actions/cache@v3 | ||
id: test-results | ||
with: | ||
paths: | ||
- target/cargo-nextest-reports/ | ||
key: ${{ runner.os }}-test-results-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-results- | ||
- name: Run docs | ||
run: cargo doc --workspace --all-features --no-deps --document-private-items --verbose | ||
- name: Cache documentation | ||
uses: actions/cache@v3 | ||
id: docs-cache | ||
with: | ||
paths: | ||
- target/doc/ | ||
key: ${{ runner.os }}-docs-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-docs- |