Skip to content

Commit c8aa047

Browse files
mockersfcart
andcommitted
Parameterize nightly toolchain in CI (#5330)
# Objective Rust's nightly builds semi-regularly break us (or our dependencies). This creates churn and angst when we're just trying to get our jobs done. We do still want nightly builds for a variety of reasons: * cargo-udeps requires nightly and likely always will. * Helps us catch rust nightly bugs quickly. We're "good citizens" if we regularly report regressions. * Lets us prepare for "actual expected breakage" ahead of stable releases so we avoid breaking main users. ## Solution * This pr parameterizes the nightly toolchain, making it an easy one-liner to pin our builds to a specific nightly, when required. * Put nightly jobs to check wasm and nightly on their own matrix. I also removed tests on nightly linux, just build check * alternative to #5329 Co-authored-by: Carter Anderson <mcanders1@gmail.com>
1 parent 56ee620 commit c8aa047

2 files changed

Lines changed: 43 additions & 27 deletions

File tree

.github/bors.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
status = [
2-
"build (stable, windows-latest)",
3-
"build (stable, ubuntu-latest)",
4-
"build (stable, macos-latest)",
5-
"build (nightly, ubuntu-latest)",
6-
"build-wasm (stable, ubuntu-latest)",
7-
"build-wasm (nightly, ubuntu-latest)",
2+
"build (windows-latest)",
3+
"build (ubuntu-latest)",
4+
"build (macos-latest)",
5+
"build-wasm",
6+
"nightly-checks (wasm32-unknown-unknown)",
7+
"nightly-checks (x86_64-unknown-linux-gnu)",
88
"build-android",
99
"markdownlint",
1010
"run-examples",

.github/workflows/ci.yml

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@ on:
99

1010
env:
1111
CARGO_TERM_COLOR: always
12+
NIGHTLY_TOOLCHAIN: nightly-2022-07-13
1213

1314
jobs:
1415
build:
1516
strategy:
1617
matrix:
17-
toolchain: [stable, nightly]
1818
os: [windows-latest, ubuntu-latest, macos-latest]
19-
exclude:
20-
- os: macos-latest
21-
toolchain: nightly
22-
- os: windows-latest
23-
toolchain: nightly
2419
runs-on: ${{ matrix.os }}
2520
steps:
2621
- uses: actions/checkout@v3
@@ -32,11 +27,7 @@ jobs:
3227
~/.cargo/registry/cache/
3328
~/.cargo/git/db/
3429
target/
35-
key: ${{ runner.os }}-cargo-build-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
36-
- uses: actions-rs/toolchain@v1
37-
with:
38-
toolchain: ${{ matrix.toolchain }}
39-
override: true
30+
key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
4031
- name: Install alsa and udev
4132
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
4233
if: runner.os == 'linux'
@@ -47,6 +38,35 @@ jobs:
4738
CARGO_INCREMENTAL: 0
4839
RUSTFLAGS: "-C debuginfo=0 -D warnings"
4940

41+
nightly-checks:
42+
strategy:
43+
matrix:
44+
target: [wasm32-unknown-unknown, x86_64-unknown-linux-gnu]
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: actions-rs/toolchain@v1
49+
with:
50+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
51+
target: ${{ matrix.target }}
52+
override: true
53+
- uses: actions/cache@v3
54+
with:
55+
path: |
56+
~/.cargo/bin/
57+
~/.cargo/registry/index/
58+
~/.cargo/registry/cache/
59+
~/.cargo/git/db/
60+
target/
61+
key: ubuntu-latest-cargo-build-stable-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}
62+
- name: Install alsa and udev
63+
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
64+
- name: Check wasm
65+
uses: actions-rs/cargo@v1
66+
with:
67+
command: check
68+
args: --target ${{ matrix.target }}
69+
5070
ci:
5171
runs-on: ubuntu-latest
5272
steps:
@@ -87,7 +107,7 @@ jobs:
87107
key: ${{ runner.os }}-cargo-miri-${{ hashFiles('**/Cargo.toml') }}
88108
- uses: actions-rs/toolchain@v1
89109
with:
90-
toolchain: nightly
110+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
91111
components: miri
92112
override: true
93113
- name: Install alsa and udev
@@ -132,11 +152,7 @@ jobs:
132152
run: cargo run -p ci -- compile
133153

134154
build-wasm:
135-
strategy:
136-
matrix:
137-
toolchain: [stable, nightly]
138-
os: [ubuntu-latest]
139-
runs-on: ${{ matrix.os }}
155+
runs-on: ubuntu-latest
140156
needs: build
141157
steps:
142158
- uses: actions/checkout@v3
@@ -148,17 +164,17 @@ jobs:
148164
~/.cargo/registry/cache/
149165
~/.cargo/git/db/
150166
target/
151-
key: ${{ runner.os }}-cargo-build-wasm-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
167+
key: ubuntu-assets-cargo-build-wasm-stable-${{ hashFiles('**/Cargo.toml') }}
152168
- uses: actions-rs/toolchain@v1
153169
with:
154-
toolchain: ${{ matrix.toolchain }}
170+
toolchain: stable
155171
target: wasm32-unknown-unknown
156172
override: true
157173
- name: Check wasm
158174
uses: actions-rs/cargo@v1
159175
with:
160176
command: check
161-
args: --target wasm32-unknown-unknown --no-default-features --features bevy_winit,x11,hdr,bevy_gltf
177+
args: --target wasm32-unknown-unknown
162178

163179
markdownlint:
164180
runs-on: ubuntu-latest
@@ -291,7 +307,7 @@ jobs:
291307
key: ${{ runner.os }}-cargo-check-unused-dependencies-${{ hashFiles('**/Cargo.toml') }}
292308
- uses: actions-rs/toolchain@v1
293309
with:
294-
toolchain: nightly
310+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
295311
override: true
296312
- name: Installs cargo-udeps
297313
run: cargo install --force cargo-udeps

0 commit comments

Comments
 (0)