-
Notifications
You must be signed in to change notification settings - Fork 16
148 lines (134 loc) · 5.63 KB
/
push.yaml
File metadata and controls
148 lines (134 loc) · 5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: push
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
# Cancel PR actions on new commits
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
env:
# For setup-rust, see https://github.com/moonrepo/setup-rust/issues/22
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test-os:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
RUST_LOG: debug
steps:
- uses: actions/checkout@v4
- uses: cargo-bins/cargo-binstall@main
- run: cargo binstall cargo-nextest
- run: cargo fetch --locked
- name: shader-crate-template cargo fetch --locked
run: |
cd ./crates/shader-crate-template
cargo fetch --locked
- run: cargo nextest run
- name: Run a full build
run: cargo xtask test-build
test-rust-gpu:
strategy:
fail-fast: false
matrix:
include:
# As well as testing on each OS, we also want to test to make sure we're still supporting
# older versions of `rust-gpu`. However, we can assume that these tests are already okay
# across platforms, so we only need to test on Linux, the chepeast in terms of minutes.
#
# `0.7.0` currently fails building `spirv-builder-cli` with:
# """
# package `is_terminal_polyfill v1.70.1` cannot be built because it requires rustc
# 1.70.0 or newer, while the currently active rustc version is 1.69.0-nightly
# """
# It's probably easily fixable. But also `0.7.0` was released in April 2023, so there's
# unlikely many users of it?
# 0.8.0 started failing as well due to `zmij v1.0.20` requiring rustc 1.71 or newer
# - rust-gpu-version: 0.8.0
# glam-version: 0.24.2
- rust-gpu-version: 0.9.0
glam-version: 0.24.2
# target spec introduction
# last version before
# * fails: compiler too old, `serde` using `#[diagnostic]`
# - rust-gpu-version: cc752312c3de6813a41189e46476d5c1be5e0bbe
# glam-version: 0.30.7
# first version requiring target specs
# * fails: target spec mismatch!
# * resolution: Since this is just a few commits, I'd be fine ignoring it.
# - rust-gpu-version: 02cefd101014f66b79dffb20a2c2b5b7c9038401
# glam-version: 0.30.7
# target specs change again just a few commits later
# * fails: compiler too old, `proc-macro2` using `Literal::byte_character`.
# * resolution: want to support, can't be bothered to hack in old proc-macro2 versions
# - rust-gpu-version: bbb61f58b3d24f3f64745050eb214b90bf6dcce9
# glam-version: 0.30.7
# testing rustc 1.5 months later
- rust-gpu-version: eea8998df9dc2fd8e7a65c5b5b7ae20c238a665a
glam-version: 0.29.3
# just after target specs v2 refactor, we updated to rustc 1.85 and needed to change them again
# before
- rust-gpu-version: a547c6e45266d613d9fec673e869d7a96181e47b
glam-version: =0.30.7
# after
- rust-gpu-version: 2326b87fe1542eeb898065e36ac949307b55386d
glam-version: =0.30.7
# glam semver breakage due to vector type refactor
# before, glam was fixed to <=0.30.7 in this commit
- rust-gpu-version: f79c4181a5dc2d37303947b113f190930c6c1ce6
glam-version: =0.30.7
# after, glam >0.30.8
- rust-gpu-version: e767f24f2565baf1a71bbaf84d453d181cab2417
# rustc 1.94.0 destabilised json target specs, requiring `-Ztarget-spec-json`
# see https://github.com/Rust-GPU/rust-gpu/pull/545
# see https://github.com/rust-lang/rust/pull/150151
# before
- rust-gpu-version: 30896871ba00e668029ccb724f1438202b284708
# after
- rust-gpu-version: 877bd8697a15f3e6d09446a5e1807e6237ca1dac
runs-on: ubuntu-latest
env:
RUST_LOG: debug
steps:
- uses: actions/checkout@v4
- if: ${{ matrix.glam-version }}
name: set glam version
run: cargo xtask set-dependency glam ${{ matrix.glam-version }}
- name: Run a full build
run: cargo xtask test-build --rust-gpu-version ${{ matrix.rust-gpu-version }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cargo-bins/cargo-binstall@main
- run: cargo binstall cargo-shear
- run: cargo fetch --locked
- run: cargo clippy -- --deny warnings
- run: cargo fmt --check
- run: cargo shear
# This allows us to have a single job we can branch protect on, rather than needing
# to update the branch protection rules when the test matrix changes
test_success:
runs-on: ubuntu-24.04
needs: [test-os, test-rust-gpu, lint]
# 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
if: ${{ always() }}
steps:
# Another hack is to actually check the status of the dependencies or else it'll fall through
- run: |
echo "Checking statuses..."
[[ "${{ needs.test-os.result }}" == "success" ]] || exit 1
[[ "${{ needs.test-rust-gpu.result }}" == "success" ]] || exit 1
[[ "${{ needs.lint.result }}" == "success" ]] || exit 1
defaults:
run:
shell: bash