2020-06-24 18:22:51 +00:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-06-18 07:52:37 +00:00
|
|
|
- master
|
2020-06-24 18:22:51 +00:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2024-06-18 07:52:37 +00:00
|
|
|
- "**.rs"
|
|
|
|
- "**/Cargo.*"
|
2024-06-19 10:16:19 +00:00
|
|
|
- ".github/workflows/test.yml"
|
2024-06-18 07:52:37 +00:00
|
|
|
- "tests/compile-fail/**.stderr"
|
2023-11-09 10:22:08 +00:00
|
|
|
merge_group:
|
2020-06-24 18:22:51 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust:
|
2024-06-18 07:52:37 +00:00
|
|
|
- stable
|
|
|
|
- beta
|
2020-06-24 18:22:51 +00:00
|
|
|
experimental:
|
2024-06-18 07:52:37 +00:00
|
|
|
- false
|
2020-06-24 18:22:51 +00:00
|
|
|
include:
|
2024-06-18 07:52:37 +00:00
|
|
|
- rust: nightly
|
|
|
|
experimental: true
|
2020-06-24 18:22:51 +00:00
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-18 07:52:37 +00:00
|
|
|
- name: Checkout
|
2024-06-19 10:16:19 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-06-18 07:52:37 +00:00
|
|
|
- name: Setup Rust toolchain
|
2024-06-19 10:16:19 +00:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
|
|
|
id: rust-toolchain
|
2024-06-18 07:52:37 +00:00
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
components: rustfmt, clippy
|
2024-06-19 10:16:19 +00:00
|
|
|
- uses: actions/cache@v4
|
2024-06-18 07:52:37 +00:00
|
|
|
with:
|
2024-06-19 10:16:19 +00:00
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
|
|
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Format
|
|
|
|
run: cargo fmt -- --check
|
2024-06-18 07:52:37 +00:00
|
|
|
- name: Clippy
|
2024-08-02 15:56:18 +00:00
|
|
|
run: cargo clippy --workspace --all-features --all-targets -- -D warnings
|
2024-06-18 07:52:37 +00:00
|
|
|
- name: Test
|
2024-06-19 10:16:19 +00:00
|
|
|
run: cargo test --workspace --all-features --all-targets
|
2024-06-18 07:52:37 +00:00
|
|
|
- name: Test docs
|
2024-06-19 10:16:19 +00:00
|
|
|
run: cargo test --workspace --all-features --doc
|
2024-06-18 07:52:37 +00:00
|
|
|
- name: Check (without default features)
|
2024-06-19 10:16:19 +00:00
|
|
|
run: cargo check --workspace --no-default-features
|
2023-11-09 22:50:40 +00:00
|
|
|
|
|
|
|
miri:
|
2024-06-18 07:52:37 +00:00
|
|
|
name: Miri
|
2023-11-09 22:50:40 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-19 10:16:19 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2023-11-09 22:50:40 +00:00
|
|
|
- name: Install Miri
|
2024-06-19 10:16:19 +00:00
|
|
|
uses: dtolnay/rust-toolchain@miri
|
|
|
|
id: rust-toolchain
|
|
|
|
- uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-miri-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-miri-
|
|
|
|
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
|
|
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Setup Miri
|
|
|
|
run: cargo miri setup
|
2023-11-09 22:50:40 +00:00
|
|
|
- name: Test with Miri
|
2024-06-19 10:16:19 +00:00
|
|
|
run: cargo miri test --no-fail-fast --all-features
|
2024-08-23 18:30:59 +00:00
|
|
|
env:
|
|
|
|
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-retag-fields
|
2024-06-18 07:52:37 +00:00
|
|
|
- name: Run examples with Miri
|
|
|
|
run: |
|
|
|
|
cargo miri run --example calc
|
2024-07-26 09:55:14 +00:00
|
|
|
|
|
|
|
benchmarks:
|
|
|
|
name: Benchmarks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Rust toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@master
|
|
|
|
id: rust-toolchain
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
|
|
|
|
- name: "Setup codspeed"
|
|
|
|
uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: cargo-codspeed
|
|
|
|
|
|
|
|
- uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
|
|
|
|
${{ runner.os }}-cargo-
|
|
|
|
|
|
|
|
- name: "Build benchmarks"
|
|
|
|
run: cargo codspeed build
|
|
|
|
|
|
|
|
- name: "Run benchmarks"
|
2024-11-20 08:17:14 +00:00
|
|
|
uses: CodSpeedHQ/action@v3
|
2024-07-26 09:55:14 +00:00
|
|
|
with:
|
|
|
|
run: cargo codspeed run
|
|
|
|
token: ${{ secrets.CODSPEED_TOKEN }}
|