• 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, 1.52.0, 1.46.0, 1.40.0, 1.39.0, 1.36.0, 1.33.0, 1.32.0, 1.31.0]
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 check --no-default-features
39      - run: cargo check --features serde
40      - run: cargo check --no-default-features --features serde
41
42  node:
43    name: Node
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@stable
51      - run: npm install semver
52      - run: cargo test
53        env:
54          RUSTFLAGS: --cfg test_node_semver ${{env.RUSTFLAGS}}
55
56  clippy:
57    name: Clippy
58    runs-on: ubuntu-latest
59    if: github.event_name != 'pull_request'
60    timeout-minutes: 45
61    steps:
62      - uses: actions/checkout@v3
63      - uses: dtolnay/rust-toolchain@clippy
64      - run: cargo clippy --tests --benches -- -Dclippy::all -Dclippy::pedantic
65
66  miri:
67    name: Miri
68    needs: pre_ci
69    if: needs.pre_ci.outputs.continue
70    runs-on: ubuntu-latest
71    env:
72      MIRIFLAGS: -Zmiri-strict-provenance
73    timeout-minutes: 45
74    steps:
75      - uses: actions/checkout@v3
76      - uses: dtolnay/rust-toolchain@miri
77      - name: Run cargo miri test (64-bit little endian)
78        run: cargo miri test --target x86_64-unknown-linux-gnu
79      - name: Run cargo miri test (64-bit big endian)
80        run: cargo miri test --target powerpc64-unknown-linux-gnu
81      - name: Run cargo miri test (32-bit little endian)
82        run: cargo miri test --target i686-unknown-linux-gnu
83      - name: Run cargo miri test (32-bit big endian)
84        run: cargo miri test --target mips-unknown-linux-gnu
85
86  fuzz:
87    name: Fuzz
88    needs: pre_ci
89    if: needs.pre_ci.outputs.continue
90    runs-on: ubuntu-latest
91    timeout-minutes: 45
92    steps:
93      - uses: actions/checkout@v3
94      - uses: dtolnay/rust-toolchain@nightly
95      - uses: dtolnay/install@cargo-fuzz
96      - run: cargo fuzz check
97
98  outdated:
99    name: Outdated
100    runs-on: ubuntu-latest
101    if: github.event_name != 'pull_request'
102    timeout-minutes: 45
103    steps:
104      - uses: actions/checkout@v3
105      - uses: dtolnay/install@cargo-outdated
106      - run: cargo outdated --workspace --exit-code 1
107      - run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1
108