Reduced total number of samples #262
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, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust-version: [ | |
1.78.0, 1.80.0, stable, beta, nightly | |
] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
override: true | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-registry- | |
- name: Cache cargo build | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-${{ matrix.rust-version }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-build-${{ matrix.rust-version }}- | |
- name: Install dependencies | |
run: | | |
cargo fetch | |
rustup component add --toolchain ${{ matrix.rust-version }} rustfmt clippy | |
- name: Run tests | |
run: cargo test --release | |
- name: Run tests with no default features | |
run: cargo test --no-default-features --release | |
- name: Run test with standard library | |
run: cargo test --features=std --release | |
- name: Check code formatting | |
run: cargo fmt -- --check | |
- name: Run Clippy | |
run: cargo clippy --features=std -- -Dclippy::all -Dclippy::cargo |