Skip to content

Commit 3d28c03

Browse files
committed
cargo-gpu merge: merge in cargo-gpu ci
1 parent 602b6a5 commit 3d28c03

File tree

1 file changed

+104
-2
lines changed

1 file changed

+104
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"
5656

5757
- name: workspace test (excluding examples)
58-
run: cargo test --release --workspace --exclude "example-runner-*" --no-default-features --features "use-installed-tools,clap"
58+
run: cargo test --release --workspace --exclude "example-runner-*" --exclude "cargo-gpu*" --no-default-features --features "use-installed-tools,clap"
5959

6060
# Examples
6161
- name: cargo check examples
@@ -180,11 +180,111 @@ jobs:
180180
- name: difftests
181181
run: cargo run -p difftests --release --no-default-features --features "use-installed-tools"
182182

183+
cargo-gpu-os:
184+
strategy:
185+
fail-fast: false
186+
matrix:
187+
os:
188+
- ubuntu-latest
189+
- macos-latest
190+
- windows-latest
191+
runs-on: ${{ matrix.os }}
192+
env:
193+
RUST_LOG: debug
194+
steps:
195+
- uses: actions/checkout@v4
196+
- uses: cargo-bins/cargo-binstall@main
197+
- run: cargo binstall cargo-nextest
198+
- run: cargo fetch --locked
199+
- name: shader-crate-template cargo fetch --locked
200+
run: |
201+
cd ./crates/shader-crate-template
202+
cargo fetch --locked
203+
- run: cargo nextest run -p cargo-gpu -p cargo-gpu-install
204+
- name: Run a full build
205+
run: cargo xtask test-build
206+
207+
cargo-gpu-backwards-compat:
208+
strategy:
209+
fail-fast: false
210+
matrix:
211+
include:
212+
# As well as testing on each OS, we also want to test to make sure we're still supporting
213+
# older versions of `rust-gpu`. However, we can assume that these tests are already okay
214+
# across platforms, so we only need to test on Linux, the chepeast in terms of minutes.
215+
#
216+
# `0.7.0` currently fails building `spirv-builder-cli` with:
217+
# """
218+
# package `is_terminal_polyfill v1.70.1` cannot be built because it requires rustc
219+
# 1.70.0 or newer, while the currently active rustc version is 1.69.0-nightly
220+
# """
221+
# It's probably easily fixable. But also `0.7.0` was released in April 2023, so there's
222+
# unlikely many users of it?
223+
224+
# 0.8.0 started failing as well due to `zmij v1.0.20` requiring rustc 1.71 or newer
225+
# - rust-gpu-version: 0.8.0
226+
# glam-version: 0.24.2
227+
- rust-gpu-version: 0.9.0
228+
glam-version: 0.24.2
229+
230+
# target spec introduction
231+
# last version before
232+
# * fails: compiler too old, `serde` using `#[diagnostic]`
233+
# - rust-gpu-version: cc752312c3de6813a41189e46476d5c1be5e0bbe
234+
# glam-version: 0.30.7
235+
# first version requiring target specs
236+
# * fails: target spec mismatch!
237+
# * resolution: Since this is just a few commits, I'd be fine ignoring it.
238+
# - rust-gpu-version: 02cefd101014f66b79dffb20a2c2b5b7c9038401
239+
# glam-version: 0.30.7
240+
# target specs change again just a few commits later
241+
# * fails: compiler too old, `proc-macro2` using `Literal::byte_character`.
242+
# * resolution: want to support, can't be bothered to hack in old proc-macro2 versions
243+
# - rust-gpu-version: bbb61f58b3d24f3f64745050eb214b90bf6dcce9
244+
# glam-version: 0.30.7
245+
246+
# testing rustc 1.5 months later
247+
- rust-gpu-version: eea8998df9dc2fd8e7a65c5b5b7ae20c238a665a
248+
glam-version: 0.29.3
249+
250+
# just after target specs v2 refactor, we updated to rustc 1.85 and needed to change them again
251+
# before
252+
- rust-gpu-version: a547c6e45266d613d9fec673e869d7a96181e47b
253+
glam-version: =0.30.7
254+
# after
255+
- rust-gpu-version: 2326b87fe1542eeb898065e36ac949307b55386d
256+
glam-version: =0.30.7
257+
258+
# glam semver breakage due to vector type refactor
259+
# before, glam was fixed to <=0.30.7 in this commit
260+
- rust-gpu-version: f79c4181a5dc2d37303947b113f190930c6c1ce6
261+
glam-version: =0.30.7
262+
# after, glam >0.30.8
263+
- rust-gpu-version: e767f24f2565baf1a71bbaf84d453d181cab2417
264+
265+
# rustc 1.94.0 destabilised json target specs, requiring `-Ztarget-spec-json`
266+
# see https://github.com/Rust-GPU/rust-gpu/pull/545
267+
# see https://github.com/rust-lang/rust/pull/150151
268+
# before
269+
- rust-gpu-version: 30896871ba00e668029ccb724f1438202b284708
270+
# after
271+
- rust-gpu-version: 877bd8697a15f3e6d09446a5e1807e6237ca1dac
272+
runs-on: ubuntu-latest
273+
env:
274+
RUST_LOG: debug
275+
steps:
276+
- uses: actions/checkout@v4
277+
- if: ${{ matrix.glam-version }}
278+
name: set glam version
279+
run: cargo xtask set-dependency glam ${{ matrix.glam-version }}
280+
- name: Run a full build
281+
run: cargo xtask test-build --rust-gpu-version ${{ matrix.rust-gpu-version }}
282+
183283
# This allows us to have a single job we can branch protect on, rather than needing
184284
# to update the branch protection rules when the test matrix changes
185285
test_success:
186286
runs-on: ubuntu-latest
187-
needs: [test, compiletest, difftest, android, lint, cargo-deny]
287+
needs: [test, compiletest, difftest, android, lint, cargo-deny, cargo-gpu-os, cargo-gpu-backwards-compat]
188288
# Hack for buggy GitHub Actions behavior with skipped checks: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
189289
if: ${{ always() }}
190290
steps:
@@ -197,6 +297,8 @@ jobs:
197297
[[ "${{ needs.android.result }}" == "success" ]] || exit 1
198298
[[ "${{ needs.lint.result }}" == "success" ]] || exit 1
199299
[[ "${{ needs.cargo-deny.result }}" == "success" ]] || exit 1
300+
[[ "${{ needs.cargo-gpu-os.result }}" == "success" ]] || exit 1
301+
[[ "${{ needs.cargo-gpu-backwards-compat.result }}" == "success" ]] || exit 1
200302
201303
lint:
202304
name: Lint

0 commit comments

Comments
 (0)