7
7
pull_request :
8
8
branches :
9
9
- main
10
+ merge_group :
11
+ branches :
12
+ - main
10
13
11
14
jobs :
12
15
rustfmt-clippy :
@@ -42,17 +45,25 @@ jobs:
42
45
steps :
43
46
- uses : actions/checkout@v3
44
47
45
- - name : Install msrv
46
- uses : actions-rs/ toolchain@v1
48
+ - name : Install msrv for lib
49
+ uses : dtolnay/rust- toolchain@master
47
50
with :
48
- profile : minimal
49
51
# MSRV below is documented in Cargo.toml and README.md, please update those if you
50
52
# change this.
51
- toolchain : 1.60.0
52
- override : true
53
+ toolchain : 1.70.0
54
+
55
+ - name : Test lib with msrv
56
+ run : cargo +1.70.0 test --package bindgen
57
+
58
+ - name : Install msrv for cli
59
+ uses : dtolnay/rust-toolchain@master
60
+ with :
61
+ # MSRV below is documented in Cargo.toml and README.md, please update those if you
62
+ # change this.
63
+ toolchain : 1.70.0
53
64
54
- - name : Build with msrv
55
- run : rm Cargo.lock && cargo +1.60 .0 build --lib
65
+ - name : Test cli with msrv
66
+ run : cargo +1.70 .0 build --package bindgen-cli
56
67
57
68
minimal :
58
69
runs-on : ubuntu-latest
85
96
toolchain : stable
86
97
override : true
87
98
88
- - name : Generate documentation
89
- run : cargo doc --document-private-items
99
+ - name : Generate documentation for `bindgen`
100
+ run : cargo doc --document-private-items --no-deps -p bindgen
101
+
102
+ - name : Generate documentation for `bindgen-cli`
103
+ run : cargo doc --document-private-items --no-deps -p bindgen-cli
90
104
91
105
quickchecking :
92
106
runs-on : ubuntu-latest
@@ -108,9 +122,7 @@ jobs:
108
122
runs-on : ${{matrix.os}}
109
123
strategy :
110
124
matrix :
111
- # TODO(#1954): These should be run on mac too, but turns out they're
112
- # broken.
113
- os : [ubuntu-latest, macos-latest]
125
+ os : [ubuntu-latest, macos-12]
114
126
steps :
115
127
- uses : actions/checkout@v3
116
128
@@ -133,7 +145,7 @@ jobs:
133
145
- debian : null
134
146
cross : null
135
147
rust : null
136
- llvm_version : ["5 .0", "9 .0"]
148
+ llvm_version : ["9 .0", "16 .0"]
137
149
main_tests : [1]
138
150
release_build : [0, 1]
139
151
no_default_features : [0, 1]
@@ -146,7 +158,7 @@ jobs:
146
158
# Test with extra asserts + docs just with latest llvm versions to
147
159
# prevent explosion
148
160
- os : ubuntu-latest
149
- llvm_version : " 9 .0"
161
+ llvm_version : " 16 .0"
150
162
release_build : 0
151
163
no_default_features : 0
152
164
feature_extra_asserts : 1
@@ -160,13 +172,16 @@ jobs:
160
172
# debian: arm64
161
173
# cross: aarch64-linux-gnu
162
174
# rust: aarch64-unknown-linux-gnu
163
- # llvm_version: "9 .0"
175
+ # llvm_version: "16 .0"
164
176
# main_tests: 0
165
177
# release_build: 0
166
178
# feature_extra_asserts: 0
167
179
168
180
# Ensure stuff works on macos too
169
- - os : macos-latest
181
+ # FIXME: Ideally should use the latest llvm version, but llvm doesn't
182
+ # provide releases for x86-64 macOS anymore which is what the runner uses.
183
+ #
184
+ - os : macos-12
170
185
llvm_version : " 9.0"
171
186
release_build : 0
172
187
no_default_features : 0
@@ -214,21 +229,46 @@ jobs:
214
229
BINDGEN_NO_DEFAULT_FEATURES : ${{matrix.no_default_features}}
215
230
run : ./ci/test.sh
216
231
217
- test-book :
232
+ check-cfg :
218
233
runs-on : ubuntu-latest
234
+ env :
235
+ RUSTFLAGS : -D warnings
219
236
steps :
220
237
- uses : actions/checkout@v3
221
-
222
- - name : Install stable
238
+
239
+ - name : Install nightly
223
240
uses : actions-rs/toolchain@v1
224
241
with :
225
242
profile : minimal
226
- toolchain : stable
243
+ toolchain : nightly
227
244
override : true
245
+
246
+ - name : Check cfg
247
+ run : cargo check -Z unstable-options -Z check-cfg
248
+
249
+ test-book :
250
+ runs-on : ubuntu-latest
251
+ steps :
252
+ - uses : actions/checkout@v3
228
253
229
254
# NOTE(emilio): Change deploy-book as well if you change this.
230
255
- name : Test book
231
256
run : |
232
257
curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar xz
233
258
./mdbook build book
234
259
./mdbook test book
260
+
261
+ # One job that "summarizes" the success state of this pipeline. This can then
262
+ # be added to branch protection, rather than having to add each job
263
+ # separately.
264
+ success :
265
+ runs-on : ubuntu-latest
266
+ needs : [rustfmt-clippy, msrv, minimal, docs, quickchecking, test-expectations, test, check-cfg, test-book]
267
+ # GitHub branch protection is exceedingly silly and treats "jobs skipped
268
+ # because a dependency failed" as success. So we have to do some
269
+ # contortions to ensure the job fails if any of its dependencies fails.
270
+ if : always() # make sure this is never "skipped"
271
+ steps :
272
+ # Manually check the status of all dependencies. `if: failure()` does not work.
273
+ - name : check if any dependency failed
274
+ run : jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
0 commit comments