Debian Codegraph @

debian/rust-vendor/thiserror/.github/workflows/ci.yml

raw
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.88.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=thiserror_nightly_testing >> $GITHUB_ENV
40 if: matrix.rust == 'nightly'
41 - run: cargo test --workspace --exclude thiserror_no_std_test
42 - run: cargo test --manifest-path tests/no-std/Cargo.toml
43 - run: cargo test --no-default-features
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 msrv:
52 name: Rust 1.71.0
53 needs: pre_ci
54 if: needs.pre_ci.outputs.continue
55 runs-on: ubuntu-latest
56 timeout-minutes: 45
57 steps:
58 - uses: actions/checkout@v7
59 - uses: dtolnay/[email protected]
60 with:
61 components: rust-src
62 - run: cargo check
63
64 minimal:
65 name: Minimal versions
66 needs: pre_ci
67 if: needs.pre_ci.outputs.continue
68 runs-on: ubuntu-latest
69 timeout-minutes: 45
70 steps:
71 - uses: actions/checkout@v7
72 - uses: dtolnay/rust-toolchain@nightly
73 - run: cargo generate-lockfile -Z minimal-versions
74 - run: cargo check --locked
75
76 doc:
77 name: Documentation
78 needs: pre_ci
79 if: needs.pre_ci.outputs.continue
80 runs-on: ubuntu-latest
81 timeout-minutes: 45
82 env:
83 RUSTDOCFLAGS: -Dwarnings
84 steps:
85 - uses: actions/checkout@v7
86 - uses: dtolnay/rust-toolchain@nightly
87 with:
88 components: rust-src
89 - uses: dtolnay/install@cargo-docs-rs
90 - run: cargo docs-rs
91
92 clippy:
93 name: Clippy
94 runs-on: ubuntu-latest
95 if: github.event_name != 'pull_request'
96 timeout-minutes: 45
97 steps:
98 - uses: actions/checkout@v7
99 - uses: dtolnay/rust-toolchain@nightly
100 with:
101 components: clippy, rust-src
102 - run: cargo clippy --tests --workspace -- -Dclippy::all -Dclippy::pedantic
103
104 miri:
105 name: Miri
106 needs: pre_ci
107 if: needs.pre_ci.outputs.continue
108 runs-on: ubuntu-latest
109 timeout-minutes: 45
110 steps:
111 - uses: actions/checkout@v7
112 - uses: dtolnay/rust-toolchain@miri
113 - run: cargo miri setup
114 - run: cargo miri test
115 env:
116 MIRIFLAGS: -Zmiri-strict-provenance
117
118 outdated:
119 name: Outdated
120 runs-on: ubuntu-latest
121 if: github.event_name != 'pull_request'
122 timeout-minutes: 45
123 steps:
124 - uses: actions/checkout@v7
125 - uses: dtolnay/rust-toolchain@stable
126 - uses: dtolnay/install@cargo-outdated
127 - run: cargo outdated --workspace --exit-code 1