• 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: [1.31.0, stable, beta]
28    timeout-minutes: 45
29    steps:
30      - uses: actions/checkout@v3
31      - uses: dtolnay/rust-toolchain@master
32        with:
33          toolchain: ${{matrix.rust}}
34      - run: cargo test
35      - run: cargo test --no-default-features
36      - run: cargo test --features span-locations
37      - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test
38        run: cargo test
39        env:
40          RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}}
41      - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test --no-default-features
42        run: cargo test --no-default-features
43        env:
44          RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}}
45
46  nightly:
47    name: Rust nightly
48    needs: pre_ci
49    if: needs.pre_ci.outputs.continue
50    runs-on: ubuntu-latest
51    timeout-minutes: 45
52    steps:
53      - uses: actions/checkout@v3
54      - uses: dtolnay/rust-toolchain@nightly
55      - name: Enable type layout randomization
56        run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
57      - run: cargo test
58      - run: cargo test --no-default-features
59      - run: cargo test --no-default-features --test features -- --ignored make_sure_no_proc_macro # run the ignored test to make sure the `proc-macro` feature is disabled
60      - run: cargo test --features span-locations
61      - run: cargo test --manifest-path tests/ui/Cargo.toml
62      - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test
63        run: cargo test
64        env:
65          RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}}
66      - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test --no-default-features
67        run: cargo test --no-default-features
68        env:
69          RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}}
70      - name: RUSTFLAGS='-Z allow-features=' cargo test
71        run: cargo test
72        env:
73          RUSTFLAGS: -Z allow-features= ${{env.RUSTFLAGS}}
74      - run: cargo update -Z minimal-versions && cargo build
75
76  webassembly:
77    name: WebAssembly
78    needs: pre_ci
79    if: needs.pre_ci.outputs.continue
80    runs-on: ubuntu-latest
81    timeout-minutes: 45
82    steps:
83      - uses: actions/checkout@v3
84      - uses: dtolnay/rust-toolchain@nightly
85        with:
86          target: wasm32-unknown-unknown
87      - run: cargo test --target wasm32-unknown-unknown --no-run
88
89  fuzz:
90    name: Fuzz
91    needs: pre_ci
92    if: needs.pre_ci.outputs.continue
93    runs-on: ubuntu-latest
94    timeout-minutes: 45
95    steps:
96      - uses: actions/checkout@v3
97      - uses: dtolnay/rust-toolchain@nightly
98      - uses: dtolnay/install@cargo-fuzz
99      - run: cargo fuzz check
100
101  clippy:
102    name: Clippy
103    runs-on: ubuntu-latest
104    if: github.event_name != 'pull_request'
105    timeout-minutes: 45
106    steps:
107      - uses: actions/checkout@v3
108      - uses: dtolnay/rust-toolchain@clippy
109      - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
110      - run: cargo clippy --tests --all-features -- -Dclippy::all -Dclippy::pedantic
111
112  miri:
113    name: Miri
114    needs: pre_ci
115    if: needs.pre_ci.outputs.continue
116    runs-on: ubuntu-latest
117    timeout-minutes: 45
118    steps:
119      - uses: actions/checkout@v3
120      - uses: dtolnay/rust-toolchain@miri
121      - run: cargo miri test
122        env:
123          MIRIFLAGS: -Zmiri-strict-provenance
124
125  outdated:
126    name: Outdated
127    runs-on: ubuntu-latest
128    if: github.event_name != 'pull_request'
129    timeout-minutes: 45
130    steps:
131      - uses: actions/checkout@v3
132      - uses: dtolnay/install@cargo-outdated
133      - run: cargo outdated --workspace --exit-code 1
134      - run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1
135