Skip to content

Commit 0087556

Browse files
switch CI jobs between windows and linux for example execution (#9489)
# Objective - Example execution on linux/vulkan on CI is segfaulting for unclear reasons - This makes a lot of noise on PRs ## Solution - Switch example execution on Linux to validation jobs (on PR merged). It will still crash but not block merging, and we'll know when it's fixed - Switch example execution on Windows to CI jobs (on PR push). It's a bit longer than on Linux but provides a useful status - Disable job commenting on PR with job execution to reduce noise --------- Co-authored-by: Alice Cecile <[email protected]>
1 parent 80db794 commit 0087556

File tree

3 files changed

+53
-107
lines changed

3 files changed

+53
-107
lines changed

.github/workflows/ci-comment-failures.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,6 @@ on:
1414
- completed
1515

1616
jobs:
17-
example-run:
18-
runs-on: ubuntu-latest
19-
if: >
20-
github.event.workflow_run.event == 'pull_request' &&
21-
github.event.workflow_run.conclusion == 'failure'
22-
steps:
23-
- name: 'Download artifact'
24-
id: find-artifact
25-
uses: actions/github-script@v6
26-
with:
27-
result-encoding: string
28-
script: |
29-
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
30-
owner: context.repo.owner,
31-
repo: context.repo.repo,
32-
run_id: ${{github.event.workflow_run.id }},
33-
});
34-
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => {
35-
return artifact.name == "example-run"
36-
});
37-
if (matchArtifacts.length == 0) { return "false" }
38-
var matchArtifact = matchArtifacts[0];
39-
var download = await github.rest.actions.downloadArtifact({
40-
owner: context.repo.owner,
41-
repo: context.repo.repo,
42-
artifact_id: matchArtifact.id,
43-
archive_format: 'zip',
44-
});
45-
var fs = require('fs');
46-
fs.writeFileSync('${{github.workspace}}/example-run.zip', Buffer.from(download.data));
47-
return "true"
48-
- run: unzip example-run.zip
49-
if: ${{ steps.find-artifact.outputs.result == 'true' }}
50-
- name: 'Comment on PR'
51-
if: ${{ steps.find-artifact.outputs.result == 'true' }}
52-
uses: actions/github-script@v6
53-
with:
54-
github-token: ${{ secrets.GITHUB_TOKEN }}
55-
script: |
56-
var fs = require('fs');
57-
var issue_number = Number(fs.readFileSync('./NR'));
58-
var last_example_run = fs.readFileSync('./last_example_run');
59-
await github.rest.issues.createComment({
60-
owner: context.repo.owner,
61-
repo: context.repo.repo,
62-
issue_number: issue_number,
63-
body: 'Example `' + last_example_run + '` failed to run, please try running it locally and check the result.'
64-
});
6517

6618
missing-examples:
6719
runs-on: ubuntu-latest

.github/workflows/ci.yml

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,14 @@ jobs:
163163
VALIDATE_MARKDOWN: true
164164
DEFAULT_BRANCH: main
165165

166-
run-examples:
167-
runs-on: ubuntu-latest
168-
timeout-minutes: 30
166+
run-examples-on-windows-dx12:
167+
runs-on: windows-latest
168+
timeout-minutes: 60
169169
steps:
170-
- name: Install Bevy dependencies
171-
run: |
172-
sudo apt-get update;
173-
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
174-
libasound2-dev libudev-dev;
175-
- name: install xvfb, llvmpipe and lavapipe
176-
run: |
177-
sudo apt-get update -y -qq
178-
sudo add-apt-repository ppa:oibaf/graphics-drivers -y
179-
sudo apt-get update
180-
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
181170
- uses: actions/checkout@v3
171+
172+
- uses: dtolnay/rust-toolchain@stable
173+
182174
- uses: actions/cache@v3
183175
with:
184176
path: |
@@ -187,48 +179,23 @@ jobs:
187179
~/.cargo/registry/cache/
188180
~/.cargo/git/db/
189181
target/
190-
key: ${{ runner.os }}-cargo-run-examples-${{ hashFiles('**/Cargo.toml') }}
191-
- uses: dtolnay/rust-toolchain@stable
182+
key: ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }}
183+
192184
- name: Build bevy
185+
shell: bash
193186
# this uses the same command as when running the example to ensure build is reused
194187
run: |
195-
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"
188+
WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing"
189+
196190
- name: Run examples
191+
shell: bash
197192
run: |
198193
for example in .github/example-run/*.ron; do
199194
example_name=`basename $example .ron`
200-
echo -n $example_name > last_example_run
201195
echo "running $example_name - "`date`
202-
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
196+
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing"
203197
sleep 10
204-
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
205-
mkdir screenshots-$example_name
206-
mv screenshot-*.png screenshots-$example_name/
207-
fi
208198
done
209-
zip traces.zip trace*.json
210-
zip -r screenshots.zip screenshots-*
211-
- name: save traces
212-
uses: actions/upload-artifact@v3
213-
with:
214-
name: example-traces.zip
215-
path: traces.zip
216-
- name: save screenshots
217-
uses: actions/upload-artifact@v3
218-
with:
219-
name: screenshots.zip
220-
path: screenshots.zip
221-
- name: Save PR number
222-
if: ${{ failure() && github.event_name == 'pull_request' }}
223-
run: |
224-
mkdir -p ./example-run
225-
echo ${{ github.event.number }} > ./example-run/NR
226-
mv last_example_run ./example-run/
227-
- uses: actions/upload-artifact@v2
228-
if: ${{ failure() && github.event_name == 'pull_request' }}
229-
with:
230-
name: example-run
231-
path: example-run/
232199
233200
check-doc:
234201
runs-on: ubuntu-latest

.github/workflows/validation-jobs.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,23 @@ jobs:
6161
- name: Build APK
6262
run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package bevy_mobile_example
6363

64-
run-examples-on-windows-dx12:
64+
run-examples-linux-vulkan:
6565
if: ${{ github.event_name == 'merge_group' }}
66-
runs-on: windows-latest
67-
timeout-minutes: 60
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 30
6868
steps:
69+
- name: Install Bevy dependencies
70+
run: |
71+
sudo apt-get update;
72+
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
73+
libasound2-dev libudev-dev;
74+
- name: install xvfb, llvmpipe and lavapipe
75+
run: |
76+
sudo apt-get update -y -qq
77+
sudo add-apt-repository ppa:oibaf/graphics-drivers -y
78+
sudo apt-get update
79+
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
6980
- uses: actions/checkout@v3
70-
71-
- uses: dtolnay/rust-toolchain@stable
72-
7381
- uses: actions/cache@v3
7482
with:
7583
path: |
@@ -78,23 +86,42 @@ jobs:
7886
~/.cargo/registry/cache/
7987
~/.cargo/git/db/
8088
target/
81-
key: ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }}
82-
89+
key: ${{ runner.os }}-cargo-run-examples-${{ hashFiles('**/Cargo.toml') }}
90+
- uses: dtolnay/rust-toolchain@stable
8391
- name: Build bevy
84-
shell: bash
8592
# this uses the same command as when running the example to ensure build is reused
8693
run: |
87-
WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing"
88-
94+
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"
8995
- name: Run examples
90-
shell: bash
9196
run: |
9297
for example in .github/example-run/*.ron; do
9398
example_name=`basename $example .ron`
99+
echo -n $example_name > last_example_run
94100
echo "running $example_name - "`date`
95-
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing"
101+
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
96102
sleep 10
103+
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
104+
mkdir screenshots-$example_name
105+
mv screenshot-*.png screenshots-$example_name/
106+
fi
97107
done
108+
zip traces.zip trace*.json
109+
zip -r screenshots.zip screenshots-*
110+
- name: save traces
111+
uses: actions/upload-artifact@v3
112+
with:
113+
name: example-traces.zip
114+
path: traces.zip
115+
- name: save screenshots
116+
uses: actions/upload-artifact@v3
117+
with:
118+
name: screenshots.zip
119+
path: screenshots.zip
120+
- uses: actions/upload-artifact@v2
121+
if: ${{ failure() && github.event_name == 'pull_request' }}
122+
with:
123+
name: example-run
124+
path: example-run/
98125

99126
run-examples-on-wasm:
100127
if: ${{ github.event_name == 'merge_group' }}

0 commit comments

Comments
 (0)