Skip to content

Commit fcd87b2

Browse files
authored
Small CI improvements (#13060)
# Objective - Some CI jobs specifically use `macos-14`, as compared to the default `macos-latest`. - `macos-latest` is equivalent to `macos-12`, but may be updated in the future. - The CI job that tests on the minimum supported Rust version (MSRV) uses environmental variables to save the toolchain version. - This specific usage is what step outputs were designed for. - Both do the same thing, but step outputs can be checked by the [Github Actions VSCode Extension](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions). - Some workflows have a `NIGHTLY_TOOLCHAIN` variable that let us pin the nightly version, in case a new release breaks CI. ## Solution - Document why certain actions required `macos-14`. - Switch MSRV step to use step outputs. - Add a small comment documenting the purpose of the `NIGHTLY_TOOLCHAIN` environmental variable.
1 parent 279e89b commit fcd87b2

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
env:
1111
CARGO_TERM_COLOR: always
12+
# If nightly is breaking CI, modify this variable to target a specific nightly version.
1213
NIGHTLY_TOOLCHAIN: nightly
1314

1415
concurrency:
@@ -70,6 +71,7 @@ jobs:
7071
run: cargo run -p ci -- lints
7172

7273
miri:
74+
# Explicity use MacOS 14 to take advantage of M1 chip.
7375
runs-on: macos-14
7476
timeout-minutes: 60
7577
steps:
@@ -228,6 +230,7 @@ jobs:
228230
229231
230232
run-examples-macos-metal:
233+
# Explicity use MacOS 14 to take advantage of M1 chip.
231234
runs-on: macos-14
232235
timeout-minutes: 30
233236
steps:
@@ -388,12 +391,13 @@ jobs:
388391
target/
389392
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
390393
- name: get MSRV
394+
id: msrv
391395
run: |
392396
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
393-
echo "MSRV=$msrv" >> $GITHUB_ENV
397+
echo "msrv=$msrv" >> $GITHUB_OUTPUT
394398
- uses: dtolnay/rust-toolchain@master
395399
with:
396-
toolchain: ${{ env.MSRV }}
400+
toolchain: ${{ steps.msrv.outputs.msrv }}
397401
- name: Install Linux dependencies
398402
uses: ./.github/actions/install-linux-deps
399403
- name: Run cargo check

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
env:
1111
CARGO_TERM_COLOR: always
1212
RUSTDOCFLAGS: --html-in-header header.html
13+
# If nightly is breaking CI, modify this variable to target a specific nightly version.
1314
NIGHTLY_TOOLCHAIN: nightly
1415

1516
# Sets the permissions to allow deploying to Github pages.

.github/workflows/validation-jobs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ concurrency:
1313

1414
env:
1515
CARGO_TERM_COLOR: always
16+
# If nightly is breaking CI, modify this variable to target a specific nightly version.
1617
NIGHTLY_TOOLCHAIN: nightly
1718

1819
jobs:

0 commit comments

Comments
 (0)