concurrent-queue/.github/workflows/ci.yml

95 lines
2.8 KiB
YAML
Raw Normal View History

2022-01-08 09:06:35 +00:00
name: CI
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 2 * * *'
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust: [nightly, beta, stable]
steps:
2022-05-01 05:12:02 +00:00
- uses: actions/checkout@v3
2022-01-08 09:06:35 +00:00
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo build --all --all-features --all-targets
- name: Run cargo check (without dev-dependencies to catch missing feature flags)
if: startsWith(matrix.rust, 'nightly')
run: cargo check -Z features=dev_dep
- run: cargo test
- run: cargo test --features portable-atomic
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Run with Loom enabled
run: cargo test --test loom --features loom
env:
RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg loom
LOOM_MAX_PREEMPTIONS: 2
- run: rustup target add thumbv7m-none-eabi
- run: cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps
2022-01-08 09:06:35 +00:00
msrv:
runs-on: ubuntu-latest
strategy:
matrix:
# When updating this, the reminder to update the minimum supported
# Rust version in Cargo.toml.
2022-01-08 09:06:35 +00:00
rust: ['1.38']
steps:
2022-05-01 05:12:02 +00:00
- uses: actions/checkout@v3
2022-01-08 09:06:35 +00:00
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo build
- run: cargo build --features portable-atomic
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- run: rustup target add thumbv7m-none-eabi
- run: cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps
2022-01-08 09:06:35 +00:00
clippy:
runs-on: ubuntu-latest
steps:
2022-05-01 05:12:02 +00:00
- uses: actions/checkout@v3
2022-01-08 09:06:35 +00:00
- name: Install Rust
run: rustup update stable
2022-07-17 12:21:41 +00:00
- run: cargo clippy --all-features --all-targets
2022-01-08 09:06:35 +00:00
fmt:
runs-on: ubuntu-latest
steps:
2022-05-01 05:12:02 +00:00
- uses: actions/checkout@v3
2022-01-08 09:06:35 +00:00
- name: Install Rust
run: rustup update stable
2022-07-02 16:13:27 +00:00
- run: cargo fmt --all --check
2022-01-08 09:06:35 +00:00
miri:
runs-on: ubuntu-latest
steps:
2022-05-01 05:12:02 +00:00
- uses: actions/checkout@v3
2022-01-08 09:06:35 +00:00
- name: Install Rust
run: rustup toolchain install nightly --component miri && rustup default nightly
- run: cargo miri test
env:
2022-05-01 06:06:48 +00:00
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
2022-01-08 09:06:35 +00:00
security_audit:
runs-on: ubuntu-latest
steps:
2022-05-01 05:12:02 +00:00
- uses: actions/checkout@v3
2022-01-08 09:06:35 +00:00
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}