| 1 |
name: Tests |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: |
| 6 |
|
| 7 |
|
| 8 |
env: |
| 9 |
CARGO_TERM_COLOR: always |
| 10 |
CARGO_INCREMENTAL: 0 |
| 11 |
CARGO_NET_RETRY: 10 |
| 12 |
CI: 1 |
| 13 |
RUST_BACKTRACE: short |
| 14 |
RUSTFLAGS: "-W rust-2021-compatibility" |
| 15 |
RUSTUP_MAX_RETRIES: 10 |
| 16 |
|
| 17 |
jobs: |
| 18 |
build: |
| 19 |
strategy: |
| 20 |
matrix: |
| 21 |
os: [macOS-latest, ubuntu-latest, windows-latest] |
| 22 |
version: [stable, nightly, "1.63"] |
| 23 |
|
| 24 |
runs-on: ${{ matrix.os }} |
| 25 |
steps: |
| 26 |
- uses: actions/checkout@v4 |
| 27 |
- uses: dtolnay/rust-toolchain@master |
| 28 |
with: |
| 29 |
toolchain: ${{ matrix.version }} |
| 30 |
components: rustfmt |
| 31 |
- name: Show Cargo and rustc version |
| 32 |
run: | |
| 33 |
cargo --version |
| 34 |
rustc --version |
| 35 |
- name: Build |
| 36 |
run: cargo build --all-targets |
| 37 |
- name: Test |
| 38 |
run: cargo test |
| 39 |
- name: rustfmt |
| 40 |
run: cargo fmt --all -- --check |
| 41 |
|
| 42 |
minimal-versions: |
| 43 |
strategy: |
| 44 |
matrix: |
| 45 |
os: [macOS-latest, ubuntu-latest, windows-latest] |
| 46 |
version: [stable, nightly, "1.63"] |
| 47 |
runs-on: ${{ matrix.os }} |
| 48 |
steps: |
| 49 |
- uses: actions/checkout@v4 |
| 50 |
- uses: dtolnay/rust-toolchain@nightly |
| 51 |
- uses: Swatinem/rust-cache@v2 |
| 52 |
- run: cargo +nightly -Zdirect-minimal-versions update |
| 53 |
- uses: dtolnay/rust-toolchain@master |
| 54 |
with: |
| 55 |
toolchain: ${{ matrix.version }} |
| 56 |
components: rustfmt |
| 57 |
- run: cargo build --all-targets |
| 58 |
- run: cargo test |