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.
This commit is contained in:
BD103 2024-04-22 18:41:45 -04:00 committed by GitHub
parent 279e89b858
commit fcd87b2528
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View file

@ -9,6 +9,7 @@ on:
env:
CARGO_TERM_COLOR: always
# If nightly is breaking CI, modify this variable to target a specific nightly version.
NIGHTLY_TOOLCHAIN: nightly
concurrency:
@ -70,6 +71,7 @@ jobs:
run: cargo run -p ci -- lints
miri:
# Explicity use MacOS 14 to take advantage of M1 chip.
runs-on: macos-14
timeout-minutes: 60
steps:
@ -228,6 +230,7 @@ jobs:
run-examples-macos-metal:
# Explicity use MacOS 14 to take advantage of M1 chip.
runs-on: macos-14
timeout-minutes: 30
steps:
@ -388,12 +391,13 @@ jobs:
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
- name: get MSRV
id: msrv
run: |
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
echo "MSRV=$msrv" >> $GITHUB_ENV
echo "msrv=$msrv" >> $GITHUB_OUTPUT
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
toolchain: ${{ steps.msrv.outputs.msrv }}
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Run cargo check

View file

@ -10,6 +10,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUSTDOCFLAGS: --html-in-header header.html
# If nightly is breaking CI, modify this variable to target a specific nightly version.
NIGHTLY_TOOLCHAIN: nightly
# Sets the permissions to allow deploying to Github pages.

View file

@ -13,6 +13,7 @@ concurrency:
env:
CARGO_TERM_COLOR: always
# If nightly is breaking CI, modify this variable to target a specific nightly version.
NIGHTLY_TOOLCHAIN: nightly
jobs: