@@ -37,25 +37,25 @@ jobs:
37
37
steps :
38
38
- uses : actions/checkout@v4
39
39
40
+ - name : Read crate metadata
41
+ id : metadata
42
+ run : echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT
43
+
40
44
- name : Install msrv for lib
41
45
uses : dtolnay/rust-toolchain@master
42
46
with :
43
- # MSRV below is documented in Cargo.toml and README.md, please update those if you
44
- # change this.
45
- toolchain : 1.70.0
47
+ toolchain : ${{ steps.metadata.outputs.rust-version }}
46
48
47
49
- name : Test lib with msrv
48
- run : cargo +1.70.0 test --package bindgen
50
+ run : cargo +${{ steps.metadata.outputs.rust-version }} test --package bindgen
49
51
50
52
- name : Install msrv for cli
51
53
uses : dtolnay/rust-toolchain@master
52
54
with :
53
- # MSRV below is documented in Cargo.toml and README.md, please update those if you
54
- # change this.
55
- toolchain : 1.70.0
55
+ toolchain : ${{ steps.metadata.outputs.rust-version }}
56
56
57
57
- name : Test cli with msrv
58
- run : cargo +1.70.0 build --package bindgen-cli
58
+ run : cargo +${{ steps.metadata.outputs.rust-version }} build --package bindgen-cli
59
59
60
60
minimal :
61
61
runs-on : ubuntu-latest
@@ -108,7 +108,7 @@ jobs:
108
108
runs-on : ${{matrix.os}}
109
109
strategy :
110
110
matrix :
111
- os : [ubuntu-latest, macos-12 ]
111
+ os : [ubuntu-latest, macos-latest ]
112
112
steps :
113
113
- uses : actions/checkout@v4
114
114
@@ -125,12 +125,7 @@ jobs:
125
125
strategy :
126
126
matrix :
127
127
os : [ubuntu-latest]
128
- target :
129
- - debian : null
130
- cross : null
131
- rust : null
132
128
llvm_version : ["9.0", "16.0"]
133
- main_tests : [1]
134
129
release_build : [0, 1]
135
130
no_default_features : [0, 1]
136
131
# FIXME: There are no pre-built static libclang libraries, so the
@@ -147,64 +142,31 @@ jobs:
147
142
no_default_features : 0
148
143
feature_extra_asserts : 1
149
144
150
- # FIXME: Seems installing multiarch packages fails:
151
- #
152
- # https://github.com/rust-lang/rust-bindgen/pull/2037/checks?check_run_id=2441799333
153
- #
154
- # - os: ubuntu-latest
155
- # target:
156
- # debian: arm64
157
- # cross: aarch64-linux-gnu
158
- # rust: aarch64-unknown-linux-gnu
159
- # llvm_version: "16.0"
160
- # main_tests: 0
161
- # release_build: 0
162
- # feature_extra_asserts: 0
163
-
164
145
# Ensure stuff works on macos too
165
- # FIXME: Ideally should use the latest llvm version, but llvm doesn't
166
- # provide releases for x86-64 macOS anymore which is what the runner uses.
167
- #
168
- - os : macos-12
169
- llvm_version : " 9.0"
146
+ - os : macos-latest
147
+ llvm_version : " 16.0"
170
148
release_build : 0
171
149
no_default_features : 0
172
150
feature_extra_asserts : 0
173
151
steps :
174
152
- uses : actions/checkout@v4
175
153
176
- - name : Install multiarch packages
177
- if : matrix.target.debian
178
- run : |
179
- sudo apt-get install binfmt-support qemu-user-static gcc-${{matrix.target.cross}} g++-${{matrix.target.cross}}
180
- source /etc/lsb-release
181
- sudo tee /etc/apt/sources.list <<EOF >/dev/null
182
- deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main
183
- deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main
184
- deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-backports main
185
- deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-security main
186
- EOF
187
- sudo dpkg --add-architecture ${{matrix.target.debian}}
188
- sudo apt-get update
189
- sudo apt-get install libc6:${{matrix.target.debian}} libstdc++6:${{matrix.target.debian}}
190
-
191
154
- name : Install stable
192
155
uses : dtolnay/rust-toolchain@master
193
156
with :
194
157
toolchain : stable
195
- target : ${{matrix.target.rust}}
196
158
- name : Install libtinfo
197
159
if : matrix.os == 'ubuntu-latest'
198
160
run : |
199
- sudo apt-get update
200
- sudo apt-get install libtinfo5
161
+ wget https://mirrors.kernel.org/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
162
+ sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
163
+ - name : Install LLVM and Clang
164
+
165
+ with :
166
+ version : ${{matrix.llvm_version}}
201
167
- name : Run all the tests
202
168
env :
203
169
GITHUB_ACTIONS_OS : ${{matrix.os}}
204
- RUST_CROSS_COMPILER : ${{matrix.target.cross}}
205
- RUST_TARGET : ${{matrix.target.rust}}
206
- LLVM_VERSION : ${{matrix.llvm_version}}
207
- BINDGEN_MAIN_TESTS : ${{matrix.main_tests}}
208
170
BINDGEN_RELEASE_BUILD : ${{matrix.release_build}}
209
171
BINDGEN_FEATURE_RUNTIME : ${{matrix.feature_runtime}}
210
172
BINDGEN_FEATURE_EXTRA_ASSERTS : ${{matrix.feature_extra_asserts}}
@@ -239,12 +201,27 @@ jobs:
239
201
./mdbook build book
240
202
./mdbook test book
241
203
204
+ # FIXME(pvdrz): this should be done inside `bindgen-test` instead
205
+ test-no-headers :
206
+ runs-on : ubuntu-latest
207
+ steps :
208
+ - uses : actions/checkout@v4
209
+
210
+ - name : Test `--help`
211
+ run : cargo run -- --help
212
+
213
+ - name : Test `--version`
214
+ run : cargo run -- --version
215
+
216
+ - name : Test `--generate-shell-completions`
217
+ run : cargo run -- --generate-shell-completions=bash
218
+
242
219
# One job that "summarizes" the success state of this pipeline. This can then
243
220
# be added to branch protection, rather than having to add each job
244
221
# separately.
245
222
success :
246
223
runs-on : ubuntu-latest
247
- needs : [rustfmt-clippy, msrv, minimal, docs, quickchecking, test-expectations, test, check-cfg, test-book]
224
+ needs : [rustfmt-clippy, msrv, minimal, docs, quickchecking, test-expectations, test, check-cfg, test-book, test-no-headers ]
248
225
# GitHub branch protection is exceedingly silly and treats "jobs skipped
249
226
# because a dependency failed" as success. So we have to do some
250
227
# contortions to ensure the job fails if any of its dependencies fails.
0 commit comments