Debian Codegraph @

.github/workflows/ci.yml

raw symbols SCIP
1 name: CI
2
3 on:
4 push:
5 pull_request:
6 workflow_dispatch:
7 schedule: [cron: "40 1 * * *"]
8
9 permissions:
10 contents: read
11
12 env:
13 RUSTFLAGS: -Dwarnings
14
15 jobs:
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.85.0]
28 timeout-minutes: 45
29 steps:
30 - uses: actions/checkout@v7
31 - uses: dtolnay/rust-toolchain@master
32 with:
33 toolchain: ${{matrix.rust}}
34 components: rust-src
35 - name: Enable type layout randomization
36 run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
37 if: matrix.rust == 'nightly'
38 - name: Enable nightly-only tests
39 run: echo RUSTFLAGS=${RUSTFLAGS}\ --cfg=anyhow_nightly_testing >> $GITHUB_ENV
40 if: matrix.rust == 'nightly'
41 - run: cargo test
42 - run: cargo check --no-default-features
43 - run: cargo check
44 - uses: actions/upload-artifact@v7
45 if: matrix.rust == 'nightly' && always()
46 with:
47 name: Cargo.lock
48 path: Cargo.lock
49 continue-on-error: true
50
51 build:
52 name: Rust ${{matrix.rust}}
53 needs: pre_ci
54 if: needs.pre_ci.outputs.continue
55 runs-on: ubuntu-latest
56 strategy:
57 fail-fast: false
58 matrix:
59 rust: [1.68.0]
60 timeout-minutes: 45
61 steps:
62 - uses: actions/checkout@v7
63 - uses: dtolnay/rust-toolchain@master
64 with:
65 toolchain: ${{matrix.rust}}
66 components: rust-src
67 - run: cargo check --manifest-path tests/crate/Cargo.toml
68 - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features
69
70 minimal:
71 name: Minimal versions
72 needs: pre_ci
73 if: needs.pre_ci.outputs.continue
74 runs-on: ubuntu-latest
75 timeout-minutes: 45
76 steps:
77 - uses: actions/checkout@v7
78 - uses: dtolnay/rust-toolchain@nightly
79 - run: cargo generate-lockfile -Z minimal-versions
80 - run: cargo check --locked
81
82 windows:
83 name: Windows
84 needs: pre_ci
85 if: needs.pre_ci.outputs.continue
86 runs-on: windows-latest
87 timeout-minutes: 45
88 steps:
89 - uses: actions/checkout@v7
90 - uses: dtolnay/rust-toolchain@stable
91 with:
92 components: rust-src
93 - run: cargo check
94
95 doc:
96 name: Documentation
97 needs: pre_ci
98 if: needs.pre_ci.outputs.continue
99 runs-on: ubuntu-latest
100 timeout-minutes: 45
101 env:
102 RUSTDOCFLAGS: -Dwarnings
103 steps:
104 - uses: actions/checkout@v7
105 - uses: dtolnay/rust-toolchain@nightly
106 with:
107 components: rust-src
108 - uses: dtolnay/install@cargo-docs-rs
109 - run: cargo docs-rs
110
111 clippy:
112 name: Clippy
113 runs-on: ubuntu-latest
114 if: github.event_name != 'pull_request'
115 timeout-minutes: 45
116 steps:
117 - uses: actions/checkout@v7
118 - uses: dtolnay/rust-toolchain@nightly
119 with:
120 components: clippy, rust-src
121 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
122
123 miri:
124 name: Miri
125 needs: pre_ci
126 if: needs.pre_ci.outputs.continue
127 runs-on: ubuntu-latest
128 timeout-minutes: 45
129 steps:
130 - uses: actions/checkout@v7
131 - uses: dtolnay/rust-toolchain@miri
132 - run: cargo miri setup
133 - run: cargo miri test
134 env:
135 MIRIFLAGS: -Zmiri-strict-provenance
136
137 outdated:
138 name: Outdated
139 runs-on: ubuntu-latest
140 if: github.event_name != 'pull_request'
141 timeout-minutes: 45
142 steps:
143 - uses: actions/checkout@v7
144 - uses: dtolnay/rust-toolchain@stable
145 - uses: dtolnay/install@cargo-outdated
146 - run: cargo outdated --workspace --exit-code 1