99
1010env :
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
1415concurrency :
3435 target/
3536 key : ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
3637 - uses : dtolnay/rust-toolchain@stable
37- - name : Install alsa and udev
38- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
39- if : runner.os == 'linux'
38+ - name : Install Linux dependencies
39+ uses : ./.github/actions/install-linux-deps
4040 - name : Build & run tests
4141 # See tools/ci/src/main.rs for the commands this runs
4242 run : cargo run -p ci -- test
@@ -61,13 +61,17 @@ jobs:
6161 - uses : dtolnay/rust-toolchain@stable
6262 with :
6363 components : rustfmt, clippy
64- - name : Install alsa and udev
65- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
64+ - name : Install Linux dependencies
65+ uses : ./.github/actions/install-linux-deps
66+ with :
67+ wayland : true
68+ xkb : true
6669 - name : CI job
6770 # See tools/ci/src/main.rs for the commands this runs
6871 run : cargo run -p ci -- lints
6972
7073 miri :
74+ # Explicity use MacOS 14 to take advantage of M1 chip.
7175 runs-on : macos-14
7276 timeout-minutes : 60
7377 steps :
@@ -118,8 +122,8 @@ jobs:
118122 - uses : dtolnay/rust-toolchain@stable
119123 with :
120124 toolchain : stable
121- - name : Install alsa and udev
122- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
125+ - name : Install Linux dependencies
126+ uses : ./.github/actions/ install-linux-deps
123127 - name : Check Compile
124128 # See tools/ci/src/main.rs for the commands this runs
125129 run : cargo run -p ci -- compile
@@ -214,7 +218,7 @@ jobs:
214218 steps :
215219 - uses : actions/checkout@v4
216220 - name : Check for typos
217- uses :
crate-ci/[email protected] .4 221+ uses :
crate-ci/[email protected] .9 218222 - name : Typos info
219223 if : failure()
220224 run : |
@@ -226,6 +230,7 @@ jobs:
226230
227231
228232 run-examples-macos-metal :
233+ # Explicity use MacOS 14 to take advantage of M1 chip.
229234 runs-on : macos-14
230235 timeout-minutes : 30
231236 steps :
@@ -284,8 +289,11 @@ jobs:
284289 target/
285290 key : ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }}
286291 - uses : dtolnay/rust-toolchain@stable
287- - name : Install alsa and udev
288- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
292+ - name : Install Linux dependencies
293+ uses : ./.github/actions/install-linux-deps
294+ with :
295+ wayland : true
296+ xkb : true
289297 - name : Build and check doc
290298 # See tools/ci/src/main.rs for the commands this runs
291299 run : cargo run -p ci -- doc
@@ -383,14 +391,15 @@ jobs:
383391 target/
384392 key : ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
385393 - name : get MSRV
394+ id : msrv
386395 run : |
387396 msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
388- echo "MSRV =$msrv" >> $GITHUB_ENV
397+ echo "msrv =$msrv" >> $GITHUB_OUTPUT
389398 - uses : dtolnay/rust-toolchain@master
390399 with :
391- toolchain : ${{ env.MSRV }}
392- - name : Install alsa and udev
393- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
400+ toolchain : ${{ steps.msrv.outputs.msrv }}
401+ - name : Install Linux dependencies
402+ uses : ./.github/actions/ install-linux-deps
394403 - name : Run cargo check
395404 id : check
396405 run : cargo check
@@ -443,8 +452,11 @@ jobs:
443452 - uses : dtolnay/rust-toolchain@master
444453 with :
445454 toolchain : ${{ env.NIGHTLY_TOOLCHAIN }}
446- - name : Install alsa and udev
447- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
455+ - name : Install Linux dependencies
456+ uses : ./.github/actions/install-linux-deps
457+ with :
458+ wayland : true
459+ xkb : true
448460 - name : Build and check cfg typos
449461 # See tools/ci/src/main.rs for the commands this runs
450462 run : cargo run -p ci -- cfg-check
0 commit comments