salsa/.github/workflows/test.yml

92 lines
2.7 KiB
YAML
Raw Normal View History

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.*"
- ".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
uses: actions/checkout@v4
2024-06-18 07:52:37 +00:00
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
id: rust-toolchain
2024-06-18 07:52:37 +00:00
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: actions/cache@v4
2024-06-18 07:52:37 +00:00
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: Format
run: cargo fmt -- --check
2024-06-18 07:52:37 +00:00
- name: Clippy
run: cargo clippy --workspace --all-features --all-targets
2024-06-18 07:52:37 +00:00
- name: Test
run: cargo test --workspace --all-features --all-targets
2024-06-18 07:52:37 +00:00
- name: Test docs
run: cargo test --workspace --all-features --doc
2024-06-18 07:52:37 +00:00
- name: Check (without default features)
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
2024-07-19 14:29:36 +00:00
continue-on-error: true # FIXME: https://github.com/salsa-rs/salsa/issues/520
2023-11-09 22:50:40 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
2023-11-09 22:50:40 +00:00
- name: Install Miri
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
run: cargo miri test --no-fail-fast --all-features
2024-06-18 07:52:37 +00:00
- name: Run examples with Miri
run: |
cargo miri run --example calc