1
1
name : CI
2
- on : [push, pull_request]
2
+ on :
3
+ push : { branches: [master] }
4
+ pull_request :
5
+
6
+ concurrency :
7
+ # Make sure that new pushes cancel running jobs
8
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9
+ cancel-in-progress : true
3
10
4
11
env :
12
+ CARGO_TERM_COLOR : always
5
13
RUSTDOCFLAGS : -Dwarnings
6
14
RUSTFLAGS : -Dwarnings
15
+ RUST_BACKTRACE : full
7
16
8
17
jobs :
9
18
test :
10
- name : Test
11
- runs-on : ${{ matrix.os }}
19
+ name : Build and test
20
+ timeout-minutes : 60
12
21
strategy :
13
22
fail-fast : false
14
23
matrix :
15
24
include :
16
25
- target : aarch64-apple-darwin
17
- os : macos-latest
18
- rust : nightly
26
+ os : macos-15
19
27
- target : aarch64-unknown-linux-gnu
20
- os : ubuntu-latest
21
- rust : nightly
28
+ os : ubuntu-24.04-arm
22
29
- target : aarch64-pc-windows-msvc
23
- os : windows-latest
24
- rust : nightly
30
+ os : windows-2025
25
31
test_verbatim : 1
26
- no_std : 1
32
+ build_only : 1
27
33
- target : arm-unknown-linux-gnueabi
28
- os : ubuntu-latest
29
- rust : nightly
34
+ os : ubuntu-24.04
30
35
- target : arm-unknown-linux-gnueabihf
31
- os : ubuntu-latest
32
- rust : nightly
36
+ os : ubuntu-24.04
37
+ - target : armv7-unknown-linux-gnueabihf
38
+ os : ubuntu-24.04
33
39
- target : i586-unknown-linux-gnu
34
- os : ubuntu-latest
35
- rust : nightly
40
+ os : ubuntu-24.04
36
41
- target : i686-unknown-linux-gnu
37
- os : ubuntu-latest
38
- rust : nightly
42
+ os : ubuntu-24.04
39
43
- target : loongarch64-unknown-linux-gnu
40
- os : ubuntu-latest
41
- rust : nightly
42
- # MIPS targets disabled since they are dropped to tier 3.
43
- # See https://github.com/rust-lang/compiler-team/issues/648
44
- # - target: mips-unknown-linux-gnu
45
- # os: ubuntu-latest
46
- # rust: nightly
47
- # - target: mips64-unknown-linux-gnuabi64
48
- # os: ubuntu-latest
49
- # rust: nightly
50
- # - target: mips64el-unknown-linux-gnuabi64
51
- # os: ubuntu-latest
52
- # rust: nightly
53
- # - target: mipsel-unknown-linux-gnu
54
- # os: ubuntu-latest
55
- # rust: nightly
44
+ os : ubuntu-24.04
56
45
- target : powerpc-unknown-linux-gnu
57
- os : ubuntu-latest
58
- rust : nightly
46
+ os : ubuntu-24.04
59
47
- target : powerpc64-unknown-linux-gnu
60
- os : ubuntu-latest
61
- rust : nightly
48
+ os : ubuntu-24.04
62
49
- target : powerpc64le-unknown-linux-gnu
63
- os : ubuntu-latest
64
- rust : nightly
50
+ os : ubuntu-24.04
65
51
- target : riscv64gc-unknown-linux-gnu
66
- os : ubuntu-latest
67
- rust : nightly
52
+ os : ubuntu-24.04
68
53
- target : thumbv6m-none-eabi
69
- os : ubuntu-latest
70
- rust : nightly
54
+ os : ubuntu-24.04
71
55
- target : thumbv7em-none-eabi
72
- os : ubuntu-latest
73
- rust : nightly
56
+ os : ubuntu-24.04
74
57
- target : thumbv7em-none-eabihf
75
- os : ubuntu-latest
76
- rust : nightly
58
+ os : ubuntu-24.04
77
59
- target : thumbv7m-none-eabi
78
- os : ubuntu-latest
79
- rust : nightly
60
+ os : ubuntu-24.04
80
61
- target : wasm32-unknown-unknown
81
- os : ubuntu-latest
82
- rust : nightly
62
+ os : ubuntu-24.04
83
63
- target : x86_64-unknown-linux-gnu
84
- os : ubuntu-latest
85
- rust : nightly
64
+ os : ubuntu-24.04
86
65
- target : x86_64-apple-darwin
87
66
os : macos-13
88
- rust : nightly
89
67
- target : i686-pc-windows-msvc
90
- os : windows-latest
91
- rust : nightly
68
+ os : windows-2025
92
69
test_verbatim : 1
93
70
- target : x86_64-pc-windows-msvc
94
- os : windows-latest
95
- rust : nightly
71
+ os : windows-2025
96
72
test_verbatim : 1
97
73
- target : i686-pc-windows-gnu
98
- os : windows-latest
99
- rust : nightly-i686-gnu
74
+ os : windows-2025
75
+ channel : nightly-i686-gnu
100
76
- target : x86_64-pc-windows-gnu
101
- os : windows-latest
102
- rust : nightly-x86_64-gnu
77
+ os : windows-2025
78
+ channel : nightly-x86_64-gnu
79
+ runs-on : ${{ matrix.os }}
80
+ env :
81
+ BUILD_ONLY : ${{ matrix.build_only }}
82
+ TEST_VERBATIM : ${{ matrix.test_verbatim }}
103
83
steps :
104
84
- name : Print runner information
105
85
run : uname -a
106
86
- uses : actions/checkout@v4
107
87
with :
108
88
submodules : true
109
89
- name : Install Rust (rustup)
110
- run : rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
111
90
shell : bash
112
- - run : rustup target add ${{ matrix.target }}
113
- - run : rustup component add llvm-tools-preview
91
+ run : |
92
+ channel="nightly"
93
+ # Account for channels that have required components (MinGW)
94
+ [ -n "${{ matrix.channel }}" ] && channel="${{ matrix.channel }}"
95
+ rustup update "$channel" --no-self-update
96
+ rustup default "$channel"
97
+ rustup target add "${{ matrix.target }}"
98
+ rustup component add llvm-tools-preview
114
99
- uses : Swatinem/rust-cache@v2
115
100
with :
116
101
key : ${{ matrix.target }}
117
102
- name : Cache Docker layers
118
103
uses : actions/cache@v4
119
- if : matrix.os == 'ubuntu-latest '
104
+ if : matrix.os == 'ubuntu-24.04 '
120
105
with :
121
106
path : /tmp/.buildx-cache
122
107
key : ${{ matrix.target }}-buildx-${{ github.sha }}
@@ -136,33 +121,49 @@ jobs:
136
121
shell : bash
137
122
138
123
# Non-linux tests just use our raw script
139
- - run : ./ci/run.sh ${{ matrix.target }}
140
- if : matrix.os != 'ubuntu-latest '
124
+ - name : Run locally
125
+ if : matrix.os != 'ubuntu-24.04 '
141
126
shell : bash
142
- env :
143
- NO_STD : ${{ matrix.no_std }}
144
- TEST_VERBATIM : ${{ matrix.test_verbatim }}
127
+ run : ./ci/run.sh ${{ matrix.target }}
145
128
146
129
# Configure buildx to use Docker layer caching
147
130
- uses : docker/setup-buildx-action@v3
148
- if : matrix.os == 'ubuntu-latest '
131
+ if : matrix.os == 'ubuntu-24.04 '
149
132
150
133
# Otherwise we use our docker containers to run builds
151
- - run : cargo generate-lockfile && ./ci/run-docker.sh ${{ matrix.target }}
152
- if : matrix.os == 'ubuntu-latest'
134
+ - name : Run in Docker
135
+ if : matrix.os == 'ubuntu-24.04'
136
+ run : cargo generate-lockfile && ./ci/run-docker.sh ${{ matrix.target }}
153
137
154
138
# Workaround to keep Docker cache smaller
155
139
# https://github.com/docker/build-push-action/issues/252
156
140
# https://github.com/moby/buildkit/issues/1896
157
141
- name : Move Docker cache
158
- if : matrix.os == 'ubuntu-latest '
142
+ if : matrix.os == 'ubuntu-24.04 '
159
143
run : |
160
144
rm -rf /tmp/.buildx-cache
161
145
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
162
146
147
+ clippy :
148
+ name : Clippy
149
+ runs-on : ubuntu-24.04
150
+ timeout-minutes : 10
151
+ steps :
152
+ - uses : actions/checkout@v4
153
+ with :
154
+ submodules : true
155
+ # Unlike rustfmt, stable clippy does not work on code with nightly features.
156
+ - name : Install nightly `clippy`
157
+ run : |
158
+ rustup set profile minimal
159
+ rustup default nightly
160
+ rustup component add clippy
161
+ - uses : Swatinem/rust-cache@v2
162
+ - run : cargo clippy -- -D clippy::all
163
+
163
164
miri :
164
165
name : Miri
165
- runs-on : ubuntu-latest
166
+ runs-on : ubuntu-24.04
166
167
steps :
167
168
- uses : actions/checkout@v4
168
169
with :
@@ -177,7 +178,7 @@ jobs:
177
178
178
179
rustfmt :
179
180
name : Rustfmt
180
- runs-on : ubuntu-latest
181
+ runs-on : ubuntu-24.04
181
182
steps :
182
183
- uses : actions/checkout@v4
183
184
with :
@@ -186,27 +187,13 @@ jobs:
186
187
run : rustup set profile minimal && rustup default stable && rustup component add rustfmt
187
188
- run : cargo fmt -- --check
188
189
189
- clippy :
190
- name : Clippy
191
- runs-on : ubuntu-latest
192
- steps :
193
- - uses : actions/checkout@v4
194
- with :
195
- submodules : true
196
- # Unlike rustfmt, stable clippy does not work on code with nightly features.
197
- - name : Install nightly `clippy`
198
- run : |
199
- rustup set profile minimal && rustup default nightly && rustup component add clippy
200
- - uses : Swatinem/rust-cache@v2
201
- - run : cargo clippy -- -D clippy::all
202
-
203
190
success :
204
191
needs :
205
192
- test
206
193
- rustfmt
207
194
- clippy
208
195
- miri
209
- runs-on : ubuntu-latest
196
+ runs-on : ubuntu-24.04
210
197
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
211
198
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
212
199
# dependencies fails.
0 commit comments