only xvfb #1632
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
merge_group: | |
pull_request: | |
push: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
NIGHTLY_TOOLCHAIN: nightly | |
jobs: | |
run-examples: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Bevy dependencies | |
run: | | |
sudo apt-get update; | |
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \ | |
libasound2-dev libudev-dev; | |
- name: install xvfb | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt install -y xvfb | |
- name: install swiftshader | |
shell: bash | |
run: | | |
set -e | |
mkdir -p swiftshader | |
curl -LsSf https://github.com/gfx-rs/ci-build/releases/latest/download/swiftshader-linux-x86_64.tar.xz | tar -xf - -C swiftshader | |
echo "VK_ICD_FILENAMES=$PWD/swiftshader/vk_swiftshader_icd.json" >> $GITHUB_ENV | |
- name: install llvmpipe, vulkan sdk | |
shell: bash | |
run: | | |
set -e | |
sudo apt-get update -y -qq | |
# vulkan sdk | |
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - | |
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list | |
sudo apt-get update | |
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev vulkan-sdk | |
- uses: actions/cache@v3 | |
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: Build bevy | |
# this uses the same command as when running the example to ensure build is reused | |
run: | | |
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" | |
- name: Run examples | |
run: | | |
echo $VK_ICD_FILENAMES | |
cat $VK_ICD_FILENAMES | |
ls `dirname $VK_ICD_FILENAMES` | |
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 DRI_PRIME=0 WGPU_BACKEND=vulkan 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 | |
zip traces.zip trace*.json | |
zip -r screenshots.zip screenshots-* | |
- name: save traces | |
uses: actions/upload-artifact@v3 | |
with: | |
name: example-traces.zip | |
path: traces.zip | |
- name: save screenshots | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshots.zip | |
path: screenshots.zip | |
- name: Save PR number | |
if: ${{ failure() && github.event_name == 'pull_request' }} | |
run: | | |
mkdir -p ./example-run | |
echo ${{ github.event.number }} > ./example-run/NR | |
mv last_example_run ./example-run/ | |
- uses: actions/upload-artifact@v2 | |
if: ${{ failure() && github.event_name == 'pull_request' }} | |
with: | |
name: example-run | |
path: example-run/ |