77 pull_request :
88 branches :
99 - main
10+ merge_group :
11+ branches :
12+ - main
1013
1114jobs :
1215 rustfmt-clippy :
@@ -42,17 +45,25 @@ jobs:
4245 steps :
4346 - uses : actions/checkout@v3
4447
45- - name : Install msrv
46- uses : actions-rs/ toolchain@v1
48+ - name : Install msrv for lib
49+ uses : dtolnay/rust- toolchain@master
4750 with :
48- profile : minimal
4951 # MSRV below is documented in Cargo.toml and README.md, please update those if you
5052 # 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
5364
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
5667
5768 minimal :
5869 runs-on : ubuntu-latest
8596 toolchain : stable
8697 override : true
8798
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
90104
91105 quickchecking :
92106 runs-on : ubuntu-latest
@@ -108,9 +122,7 @@ jobs:
108122 runs-on : ${{matrix.os}}
109123 strategy :
110124 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]
114126 steps :
115127 - uses : actions/checkout@v3
116128
@@ -133,7 +145,7 @@ jobs:
133145 - debian : null
134146 cross : null
135147 rust : null
136- llvm_version : ["5 .0", "9 .0"]
148+ llvm_version : ["9 .0", "16 .0"]
137149 main_tests : [1]
138150 release_build : [0, 1]
139151 no_default_features : [0, 1]
@@ -146,7 +158,7 @@ jobs:
146158 # Test with extra asserts + docs just with latest llvm versions to
147159 # prevent explosion
148160 - os : ubuntu-latest
149- llvm_version : " 9 .0"
161+ llvm_version : " 16 .0"
150162 release_build : 0
151163 no_default_features : 0
152164 feature_extra_asserts : 1
@@ -160,13 +172,16 @@ jobs:
160172 # debian: arm64
161173 # cross: aarch64-linux-gnu
162174 # rust: aarch64-unknown-linux-gnu
163- # llvm_version: "9 .0"
175+ # llvm_version: "16 .0"
164176 # main_tests: 0
165177 # release_build: 0
166178 # feature_extra_asserts: 0
167179
168180 # 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
170185 llvm_version : " 9.0"
171186 release_build : 0
172187 no_default_features : 0
@@ -214,21 +229,46 @@ jobs:
214229 BINDGEN_NO_DEFAULT_FEATURES : ${{matrix.no_default_features}}
215230 run : ./ci/test.sh
216231
217- test-book :
232+ check-cfg :
218233 runs-on : ubuntu-latest
234+ env :
235+ RUSTFLAGS : -D warnings
219236 steps :
220237 - uses : actions/checkout@v3
221-
222- - name : Install stable
238+
239+ - name : Install nightly
223240 uses : actions-rs/toolchain@v1
224241 with :
225242 profile : minimal
226- toolchain : stable
243+ toolchain : nightly
227244 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
228253
229254 # NOTE(emilio): Change deploy-book as well if you change this.
230255 - name : Test book
231256 run : |
232257 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
233258 ./mdbook build book
234259 ./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