
# Objective - next step for #15918 ## Solution - Move jobs for macOS, Linux and Windows to their own workflow - Remove running on push to `main` from workflows CI and validation
188 lines
6.7 KiB
YAML
188 lines
6.7 KiB
YAML
name: Example Run
|
|
|
|
on:
|
|
merge_group:
|
|
pull_request:
|
|
# also run when pushed to main to update reference screenshots
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_PROFILE_TEST_DEBUG: 0
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
|
|
jobs:
|
|
run-examples-macos-metal:
|
|
runs-on: macos-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Disable audio
|
|
# Disable audio through a patch. on github m1 runners, audio timeouts after 15 minutes
|
|
run: git apply --ignore-whitespace tools/example-showcase/disable-audio.patch
|
|
- name: Run examples
|
|
run: |
|
|
for example in .github/example-run/*.ron; do
|
|
example_name=`basename $example .ron`
|
|
echo -n $example_name > last_example_run
|
|
echo "running $example_name - "`date`
|
|
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
|
|
sleep 10
|
|
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
|
|
mkdir screenshots-$example_name
|
|
mv screenshot-*.png screenshots-$example_name/
|
|
fi
|
|
done
|
|
mkdir traces && mv trace*.json traces/
|
|
mkdir screenshots && mv screenshots-* screenshots/
|
|
- name: save traces
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: example-traces-macos
|
|
path: traces
|
|
- name: Save PR number
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
run: |
|
|
echo ${{ github.event.number }} > ./screenshots/PR
|
|
- name: save screenshots
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: screenshots-macos
|
|
path: screenshots
|
|
- uses: actions/upload-artifact@v4
|
|
if: ${{ failure() && github.event_name == 'pull_request' }}
|
|
with:
|
|
name: example-run-macos
|
|
path: example-run/
|
|
|
|
compare-macos-screenshots:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
name: Compare Macos screenshots
|
|
needs: [run-examples-macos-metal]
|
|
uses: ./.github/workflows/send-screenshots-to-pixeleagle.yml
|
|
with:
|
|
commit: ${{ github.sha }}
|
|
branch: ${{ github.ref_name }}
|
|
artifact: screenshots-macos
|
|
os: macos
|
|
secrets: inherit
|
|
|
|
run-examples-linux-vulkan:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Linux dependencies
|
|
uses: ./.github/actions/install-linux-deps
|
|
# At some point this may be merged into `install-linux-deps`, but for now it is its own step.
|
|
- name: Install additional Linux dependencies for Vulkan
|
|
run: |
|
|
sudo add-apt-repository ppa:kisak/turtle -y
|
|
sudo apt-get install --no-install-recommends libxkbcommon-x11-0 xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-cargo-run-examples-${{ hashFiles('**/Cargo.toml') }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Run examples
|
|
run: |
|
|
for example in .github/example-run/*.ron; do
|
|
example_name=`basename $example .ron`
|
|
echo -n $example_name > last_example_run
|
|
echo "running $example_name - "`date`
|
|
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"
|
|
sleep 10
|
|
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
|
|
mkdir screenshots-$example_name
|
|
mv screenshot-*.png screenshots-$example_name/
|
|
fi
|
|
done
|
|
mkdir traces && mv trace*.json traces/
|
|
mkdir screenshots && mv screenshots-* screenshots/
|
|
- name: save traces
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: example-traces-linux
|
|
path: traces
|
|
- name: save screenshots
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: screenshots-linux
|
|
path: screenshots
|
|
- uses: actions/upload-artifact@v4
|
|
if: ${{ failure() && github.event_name == 'pull_request' }}
|
|
with:
|
|
name: example-run-linux
|
|
path: example-run/
|
|
|
|
compare-linux-screenshots:
|
|
name: Compare Linux screenshots
|
|
needs: [run-examples-linux-vulkan]
|
|
uses: ./.github/workflows/send-screenshots-to-pixeleagle.yml
|
|
with:
|
|
commit: ${{ github.sha }}
|
|
branch: ${{ github.ref_name }}
|
|
artifact: screenshots-linux
|
|
os: linux
|
|
secrets: inherit
|
|
|
|
run-examples-on-windows-dx12:
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
runs-on: windows-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Run examples
|
|
shell: bash
|
|
run: |
|
|
for example in .github/example-run/*.ron; do
|
|
example_name=`basename $example .ron`
|
|
echo -n $example_name > last_example_run
|
|
echo "running $example_name - "`date`
|
|
time WGPU_BACKEND=dx12 TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "statically-linked-dxc,bevy_ci_testing,trace,trace_chrome"
|
|
sleep 10
|
|
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
|
|
mkdir screenshots-$example_name
|
|
mv screenshot-*.png screenshots-$example_name/
|
|
fi
|
|
done
|
|
mkdir traces && mv trace*.json traces/
|
|
mkdir screenshots && mv screenshots-* screenshots/
|
|
- name: save traces
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: example-traces-windows
|
|
path: traces
|
|
- name: save screenshots
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: screenshots-windows
|
|
path: screenshots
|
|
- uses: actions/upload-artifact@v4
|
|
if: ${{ failure() && github.event_name == 'pull_request' }}
|
|
with:
|
|
name: example-run-windows
|
|
path: example-run/
|
|
|
|
compare-windows-screenshots:
|
|
name: Compare Windows screenshots
|
|
needs: [run-examples-on-windows-dx12]
|
|
uses: ./.github/workflows/send-screenshots-to-pixeleagle.yml
|
|
with:
|
|
commit: ${{ github.sha }}
|
|
branch: ${{ github.ref_name }}
|
|
artifact: screenshots-windows
|
|
os: windows
|
|
secrets: inherit
|