2022-01-08 12:33:35 +00:00
|
|
|
name: CI
|
|
|
|
|
2023-01-21 11:32:53 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-01-08 12:33:35 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
schedule:
|
2022-12-28 02:57:53 +00:00
|
|
|
- cron: '0 2 * * 0'
|
2022-01-08 12:33:35 +00:00
|
|
|
|
|
|
|
env:
|
2022-12-28 02:57:53 +00:00
|
|
|
CARGO_INCREMENTAL: 0
|
2023-01-21 11:06:57 +00:00
|
|
|
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
2022-12-28 02:57:53 +00:00
|
|
|
CARGO_NET_RETRY: 10
|
|
|
|
CARGO_TERM_COLOR: always
|
2022-01-08 12:33:35 +00:00
|
|
|
RUST_BACKTRACE: 1
|
2022-12-28 02:57:53 +00:00
|
|
|
RUSTFLAGS: -D warnings
|
|
|
|
RUSTDOCFLAGS: -D warnings
|
|
|
|
RUSTUP_MAX_RETRIES: 10
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2022-01-08 12:33:35 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
rust: [nightly, beta, stable]
|
|
|
|
steps:
|
2022-05-01 04:35:15 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-08 12:33:35 +00:00
|
|
|
- name: Install Rust
|
|
|
|
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
|
|
|
|
- run: cargo build --all --all-features --all-targets
|
|
|
|
if: startsWith(matrix.rust, 'nightly')
|
|
|
|
- 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
|
|
|
|
|
|
|
|
msrv:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# When updating this, the reminder to update the minimum supported
|
2022-11-09 02:33:00 +00:00
|
|
|
# Rust version in Cargo.toml.
|
2023-03-05 16:43:03 +00:00
|
|
|
rust: ['1.48']
|
2022-01-08 12:33:35 +00:00
|
|
|
steps:
|
2022-05-01 04:35:15 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-08 12:33:35 +00:00
|
|
|
- name: Install Rust
|
|
|
|
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
|
|
|
|
- run: cargo build
|
|
|
|
|
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-05-01 04:35:15 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-08 12:33:35 +00:00
|
|
|
- name: Install Rust
|
|
|
|
run: rustup update stable
|
2023-01-23 19:30:43 +00:00
|
|
|
- run: cargo clippy --all-features --all-targets
|
2022-01-08 12:33:35 +00:00
|
|
|
|
|
|
|
fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-05-01 04:35:15 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-08 12:33:35 +00:00
|
|
|
- name: Install Rust
|
|
|
|
run: rustup update stable
|
2022-07-07 16:12:38 +00:00
|
|
|
- run: cargo fmt --all --check
|
2022-01-08 12:33:35 +00:00
|
|
|
|
2022-07-07 16:21:16 +00:00
|
|
|
miri:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install Rust
|
|
|
|
run: rustup toolchain install nightly --component miri && rustup default nightly
|
|
|
|
- run: cargo miri test
|
|
|
|
env:
|
2022-08-16 13:54:23 +00:00
|
|
|
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
|
2022-07-07 16:21:16 +00:00
|
|
|
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
|
|
|
|
|
2022-01-08 12:33:35 +00:00
|
|
|
security_audit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-05-01 04:35:15 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-12-28 02:57:53 +00:00
|
|
|
# https://github.com/rustsec/audit-check/issues/2
|
|
|
|
- uses: rustsec/audit-check@master
|
2022-01-08 12:33:35 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|