• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  push:
5  pull_request:
6  workflow_dispatch:
7  schedule: [cron: "40 1 * * *"]
8
9permissions:
10  contents: read
11
12env:
13  RUSTFLAGS: -Dwarnings
14
15jobs:
16  pre_ci:
17    uses: dtolnay/.github/.github/workflows/pre_ci.yml@master
18
19  test:
20    name: Rust ${{matrix.rust}}
21    needs: pre_ci
22    if: needs.pre_ci.outputs.continue
23    runs-on: ubuntu-latest
24    strategy:
25      fail-fast: false
26      matrix:
27        rust: [nightly, beta, stable]
28    timeout-minutes: 45
29    steps:
30      - uses: actions/checkout@v3
31      - uses: dtolnay/rust-toolchain@master
32        with:
33          toolchain: ${{matrix.rust}}
34      - name: Enable type layout randomization
35        run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
36        if: matrix.rust == 'nightly'
37      - run: cargo test
38      - run: cargo test --features small
39      - run: cargo build --tests --features no-panic --release
40        if: matrix.rust == 'nightly'
41
42  msrv:
43    name: Rust 1.36.0
44    needs: pre_ci
45    if: needs.pre_ci.outputs.continue
46    runs-on: ubuntu-latest
47    timeout-minutes: 45
48    steps:
49      - uses: actions/checkout@v3
50      - uses: dtolnay/rust-toolchain@1.36.0
51      - run: cargo build
52      - run: cargo build --features small
53
54  miri:
55    name: Miri
56    needs: pre_ci
57    if: needs.pre_ci.outputs.continue
58    runs-on: ubuntu-latest
59    timeout-minutes: 45
60    steps:
61      - uses: actions/checkout@v3
62      - uses: dtolnay/rust-toolchain@miri
63      - run: cargo miri test
64        env:
65          MIRIFLAGS: -Zmiri-strict-provenance
66
67  clippy:
68    name: Clippy
69    runs-on: ubuntu-latest
70    if: github.event_name != 'pull_request'
71    timeout-minutes: 45
72    steps:
73      - uses: actions/checkout@v3
74      - uses: dtolnay/rust-toolchain@clippy
75      - run: cargo clippy --tests --benches -- -Dclippy::all -Dclippy::pedantic
76
77  outdated:
78    name: Outdated
79    runs-on: ubuntu-latest
80    if: github.event_name != 'pull_request'
81    timeout-minutes: 45
82    steps:
83      - uses: actions/checkout@v3
84      - uses: dtolnay/install@cargo-outdated
85      - run: cargo outdated --workspace --exit-code 1
86      - run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1
87
88  fuzz:
89    name: Fuzz
90    needs: pre_ci
91    if: needs.pre_ci.outputs.continue
92    runs-on: ubuntu-latest
93    timeout-minutes: 45
94    steps:
95      - uses: actions/checkout@v3
96      - uses: dtolnay/rust-toolchain@nightly
97      - uses: dtolnay/install@cargo-fuzz
98      - run: cargo fuzz check
99