Skip to content

Commit 08ce579

Browse files
authored
CI: run long tasks on new macOS runners (#12133)
# Objective - Make PR CI faster ## Solution - Run example on macOS, Windows examples are now run on PR merge instead. This is the biggest change in duration - Run miri on macOS. It doesn't change much the duration, but will free a runner 2 minutes earlier - Don't run check-doc job as it hangs on macOS. Don't move too many job as there are less macOS-14 runners globally available and they are more limited before: <img width="794" alt="Screenshot 2024-02-26 at 20 47 07" src="https://github.com/bevyengine/bevy/assets/8672791/349292a1-cddd-4e4b-aba9-4dbaef1fc4d6"> after <img width="790" alt="Screenshot 2024-02-26 at 20 47 23" src="https://github.com/bevyengine/bevy/assets/8672791/7b0983b2-0a8a-44d2-9bde-e4c6ecfbf97a">
1 parent ae9b4fc commit 08ce579

File tree

2 files changed

+48
-42
lines changed

2 files changed

+48
-42
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
run: cargo run -p ci -- lints
6565

6666
miri:
67-
runs-on: ubuntu-latest
67+
runs-on: macos-14
6868
timeout-minutes: 60
6969
steps:
7070
- uses: actions/checkout@v4
@@ -81,8 +81,6 @@ jobs:
8181
with:
8282
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
8383
components: miri
84-
- name: Install alsa and udev
85-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
8684
- name: CI job
8785
# To run the tests one item at a time for troubleshooting, use
8886
# cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-permissive-provenance -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact
@@ -200,39 +198,49 @@ jobs:
200198
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode'
201199
202200
203-
run-examples-on-windows-dx12:
204-
runs-on: windows-latest
205-
timeout-minutes: 60
201+
run-examples-macos-metal:
202+
runs-on: macos-14
203+
timeout-minutes: 30
206204
steps:
207205
- uses: actions/checkout@v4
208-
209206
- uses: dtolnay/rust-toolchain@stable
210-
211-
- uses: actions/cache@v4
212-
with:
213-
path: |
214-
~/.cargo/bin/
215-
~/.cargo/registry/index/
216-
~/.cargo/registry/cache/
217-
~/.cargo/git/db/
218-
target/
219-
key: ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }}
220-
207+
- name: Disable audio
208+
# Disable audio through a patch. on github m1 runners, audio timeouts after 15 minutes
209+
run: git apply --ignore-whitespace tools/example-showcase/disable-audio.patch
221210
- name: Build bevy
222-
shell: bash
223211
# this uses the same command as when running the example to ensure build is reused
224212
run: |
225-
WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing"
226-
213+
TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome"
227214
- name: Run examples
228-
shell: bash
229215
run: |
230216
for example in .github/example-run/*.ron; do
231217
example_name=`basename $example .ron`
218+
echo -n $example_name > last_example_run
232219
echo "running $example_name - "`date`
233-
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing"
220+
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
234221
sleep 10
222+
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
223+
mkdir screenshots-$example_name
224+
mv screenshot-*.png screenshots-$example_name/
225+
fi
235226
done
227+
mkdir traces && mv trace*.json traces/
228+
mkdir screenshots && mv screenshots-* screenshots/
229+
- name: save traces
230+
uses: actions/upload-artifact@v4
231+
with:
232+
name: example-traces-macos
233+
path: traces
234+
- name: save screenshots
235+
uses: actions/upload-artifact@v4
236+
with:
237+
name: screenshots-macos
238+
path: screenshots
239+
- uses: actions/upload-artifact@v4
240+
if: ${{ failure() && github.event_name == 'pull_request' }}
241+
with:
242+
name: example-run-macos
243+
path: example-run/
236244

237245
check-doc:
238246
runs-on: ubuntu-latest
@@ -251,7 +259,6 @@ jobs:
251259
- uses: dtolnay/rust-toolchain@stable
252260
- name: Install alsa and udev
253261
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
254-
if: runner.os == 'linux'
255262
- name: Build and check doc
256263
# See tools/ci/src/main.rs for the commands this runs
257264
run: cargo run -p ci -- doc

.github/workflows/validation-jobs.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,67 +105,66 @@ jobs:
105105
mv screenshot-*.png screenshots-$example_name/
106106
fi
107107
done
108-
zip traces.zip trace*.json
109-
zip -r screenshots.zip screenshots-*
108+
mkdir traces && mv trace*.json traces/
109+
mkdir screenshots && mv screenshots-* screenshots/
110110
- name: save traces
111111
uses: actions/upload-artifact@v4
112112
with:
113113
name: example-traces-linux
114-
path: traces.zip
114+
path: traces
115115
- name: save screenshots
116116
uses: actions/upload-artifact@v4
117117
with:
118118
name: screenshots-linux
119-
path: screenshots.zip
119+
path: screenshots
120120
- uses: actions/upload-artifact@v4
121121
if: ${{ failure() && github.event_name == 'pull_request' }}
122122
with:
123123
name: example-run-linux
124124
path: example-run/
125125

126-
run-examples-macos-metal:
126+
run-examples-on-windows-dx12:
127127
if: ${{ github.event_name == 'merge_group' }}
128-
runs-on: macos-14
128+
runs-on: windows-latest
129129
timeout-minutes: 30
130130
steps:
131131
- uses: actions/checkout@v4
132132
- uses: dtolnay/rust-toolchain@stable
133-
- name: Disable audio
134-
# Disable audio through a patch. on github m1 runners, audio timeouts after 15 minutes
135-
run: git apply --ignore-whitespace tools/example-showcase/disable-audio.patch
136133
- name: Build bevy
134+
shell: bash
137135
# this uses the same command as when running the example to ensure build is reused
138136
run: |
139-
TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome"
137+
WGPU_BACKEND=dx12 TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome"
140138
- name: Run examples
139+
shell: bash
141140
run: |
142141
for example in .github/example-run/*.ron; do
143142
example_name=`basename $example .ron`
144143
echo -n $example_name > last_example_run
145144
echo "running $example_name - "`date`
146-
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
145+
time WGPU_BACKEND=dx12 TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
147146
sleep 10
148147
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
149148
mkdir screenshots-$example_name
150149
mv screenshot-*.png screenshots-$example_name/
151150
fi
152151
done
153-
zip traces.zip trace*.json
154-
zip -r screenshots.zip screenshots-*
152+
mkdir traces && mv trace*.json traces/
153+
mkdir screenshots && mv screenshots-* screenshots/
155154
- name: save traces
156155
uses: actions/upload-artifact@v4
157156
with:
158-
name: example-traces-macos
159-
path: traces.zip
157+
name: example-traces-windows
158+
path: traces
160159
- name: save screenshots
161160
uses: actions/upload-artifact@v4
162161
with:
163-
name: screenshots-macos
164-
path: screenshots.zip
162+
name: screenshots-windows
163+
path: screenshots
165164
- uses: actions/upload-artifact@v4
166165
if: ${{ failure() && github.event_name == 'pull_request' }}
167166
with:
168-
name: example-run-macos
167+
name: example-run-windows
169168
path: example-run/
170169

171170
run-examples-on-wasm:

0 commit comments

Comments
 (0)