@@ -37,25 +37,25 @@ jobs:
3737 steps :
3838 - uses : actions/checkout@v4
3939
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+
4044 - name : Install msrv for lib
4145 uses : dtolnay/rust-toolchain@master
4246 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 }}
4648
4749 - 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
4951
5052 - name : Install msrv for cli
5153 uses : dtolnay/rust-toolchain@master
5254 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 }}
5656
5757 - 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
5959
6060 minimal :
6161 runs-on : ubuntu-latest
@@ -108,7 +108,7 @@ jobs:
108108 runs-on : ${{matrix.os}}
109109 strategy :
110110 matrix :
111- os : [ubuntu-latest, macos-12 ]
111+ os : [ubuntu-latest, macos-latest ]
112112 steps :
113113 - uses : actions/checkout@v4
114114
@@ -125,12 +125,7 @@ jobs:
125125 strategy :
126126 matrix :
127127 os : [ubuntu-latest]
128- target :
129- - debian : null
130- cross : null
131- rust : null
132128 llvm_version : ["9.0", "16.0"]
133- main_tests : [1]
134129 release_build : [0, 1]
135130 no_default_features : [0, 1]
136131 # FIXME: There are no pre-built static libclang libraries, so the
@@ -147,64 +142,31 @@ jobs:
147142 no_default_features : 0
148143 feature_extra_asserts : 1
149144
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-
164145 # 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"
170148 release_build : 0
171149 no_default_features : 0
172150 feature_extra_asserts : 0
173151 steps :
174152 - uses : actions/checkout@v4
175153
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-
191154 - name : Install stable
192155 uses : dtolnay/rust-toolchain@master
193156 with :
194157 toolchain : stable
195- target : ${{matrix.target.rust}}
196158 - name : Install libtinfo
197159 if : matrix.os == 'ubuntu-latest'
198160 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+ uses : KyleMayes/install-llvm-action@v2.0.5
165+ with :
166+ version : ${{matrix.llvm_version}}
201167 - name : Run all the tests
202168 env :
203169 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}}
208170 BINDGEN_RELEASE_BUILD : ${{matrix.release_build}}
209171 BINDGEN_FEATURE_RUNTIME : ${{matrix.feature_runtime}}
210172 BINDGEN_FEATURE_EXTRA_ASSERTS : ${{matrix.feature_extra_asserts}}
@@ -239,12 +201,27 @@ jobs:
239201 ./mdbook build book
240202 ./mdbook test book
241203
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+
242219 # One job that "summarizes" the success state of this pipeline. This can then
243220 # be added to branch protection, rather than having to add each job
244221 # separately.
245222 success :
246223 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 ]
248225 # GitHub branch protection is exceedingly silly and treats "jobs skipped
249226 # because a dependency failed" as success. So we have to do some
250227 # contortions to ensure the job fails if any of its dependencies fails.
0 commit comments