Debian Codegraph @

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