2022-05-31 17:30:31 +00:00
|
|
|
name: validation jobs
|
|
|
|
|
|
|
|
on:
|
2023-03-06 06:08:21 +00:00
|
|
|
merge_group:
|
2023-03-07 01:37:33 +00:00
|
|
|
pull_request:
|
2022-05-31 17:30:31 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2023-03-07 21:42:53 +00:00
|
|
|
NIGHTLY_TOOLCHAIN: nightly
|
2022-05-31 17:30:31 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-install-on-iOS:
|
2023-03-07 01:37:33 +00:00
|
|
|
if: ${{ github.event_name == 'merge_group' }}
|
2022-05-31 17:30:31 +00:00
|
|
|
runs-on: macos-latest
|
2023-02-01 15:08:31 +00:00
|
|
|
timeout-minutes: 30
|
2022-05-31 17:30:31 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-10-31 17:36:23 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2022-05-31 17:30:31 +00:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
target
|
|
|
|
key: ${{ runner.os }}-ios-install-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: Add iOS targets
|
|
|
|
run: rustup target add aarch64-apple-ios x86_64-apple-ios
|
|
|
|
|
|
|
|
- name: Build and install iOS app in iOS Simulator.
|
2023-02-06 18:08:49 +00:00
|
|
|
run: cd examples/mobile && make install
|
2022-05-31 17:30:31 +00:00
|
|
|
|
|
|
|
build-android:
|
2023-03-07 01:37:33 +00:00
|
|
|
if: ${{ github.event_name == 'merge_group' }}
|
2022-05-31 17:30:31 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-01 15:08:31 +00:00
|
|
|
timeout-minutes: 30
|
2022-05-31 17:30:31 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-10-31 17:36:23 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2022-09-25 00:57:07 +00:00
|
|
|
|
2022-05-31 17:30:31 +00:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-cargo-build-android-${{ hashFiles('**/Cargo.toml') }}
|
2022-09-25 00:57:07 +00:00
|
|
|
|
2022-05-31 17:30:31 +00:00
|
|
|
- name: Install Android targets
|
|
|
|
run: rustup target add aarch64-linux-android armv7-linux-androideabi
|
2022-09-25 00:57:07 +00:00
|
|
|
|
2022-05-31 17:30:31 +00:00
|
|
|
- name: Install Cargo APK
|
|
|
|
run: cargo install --force cargo-apk
|
2022-09-25 00:57:07 +00:00
|
|
|
|
2022-05-31 17:30:31 +00:00
|
|
|
- name: Build APK
|
2023-02-06 18:08:49 +00:00
|
|
|
run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package bevy_mobile_example
|
2022-05-31 17:30:31 +00:00
|
|
|
|
2022-07-14 21:17:16 +00:00
|
|
|
run-examples-on-windows-dx12:
|
2023-03-07 01:37:33 +00:00
|
|
|
if: ${{ github.event_name == 'merge_group' }}
|
2022-05-31 17:30:31 +00:00
|
|
|
runs-on: windows-latest
|
2022-07-14 21:17:16 +00:00
|
|
|
timeout-minutes: 60
|
2022-05-31 17:30:31 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-10-31 17:36:23 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2022-05-31 17:30:31 +00:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
|
|
|
|
- name: Build bevy
|
2022-07-17 14:43:35 +00:00
|
|
|
shell: bash
|
|
|
|
# this uses the same command as when running the example to ensure build is reused
|
2022-05-31 17:30:31 +00:00
|
|
|
run: |
|
2023-02-17 01:00:07 +00:00
|
|
|
WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing"
|
2022-05-31 17:30:31 +00:00
|
|
|
|
|
|
|
- name: Run examples
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
for example in .github/example-run/*.ron; do
|
|
|
|
example_name=`basename $example .ron`
|
|
|
|
echo "running $example_name - "`date`
|
2023-02-17 01:00:07 +00:00
|
|
|
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing"
|
2022-05-31 17:30:31 +00:00
|
|
|
sleep 10
|
|
|
|
done
|
2022-06-06 20:22:51 +00:00
|
|
|
|
|
|
|
run-examples-on-wasm:
|
2023-03-07 01:37:33 +00:00
|
|
|
if: ${{ github.event_name == 'merge_group' }}
|
2022-12-08 20:05:27 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-06 20:22:51 +00:00
|
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-10-31 17:36:23 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2022-06-06 20:22:51 +00:00
|
|
|
with:
|
|
|
|
target: wasm32-unknown-unknown
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
~/.github/start-wasm-example/node_modules
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-wasm-run-examples-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
|
|
|
|
- name: install xvfb, llvmpipe and lavapipe
|
|
|
|
run: |
|
|
|
|
sudo apt-get update -y -qq
|
|
|
|
sudo add-apt-repository ppa:oibaf/graphics-drivers -y
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
|
|
|
|
|
|
|
|
- name: Install wasm-bindgen
|
|
|
|
run: cargo install --force wasm-bindgen-cli
|
|
|
|
|
|
|
|
- name: Setup playwright
|
|
|
|
run: |
|
|
|
|
cd .github/start-wasm-example
|
|
|
|
npm install
|
|
|
|
npx playwright install --with-deps
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
- name: First WASM build
|
|
|
|
run: |
|
|
|
|
cargo build --release --example ui --target wasm32-unknown-unknown
|
|
|
|
|
|
|
|
- name: Run examples
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
# start a webserver
|
|
|
|
python3 -m http.server --directory examples/wasm &
|
|
|
|
|
2022-09-25 00:57:07 +00:00
|
|
|
xvfb-run cargo run -p build-wasm-example -- --browsers chromium --browsers firefox --frames 25 --test 2d_shapes lighting text_debug breakout
|
2022-06-06 20:22:51 +00:00
|
|
|
|
|
|
|
- name: Save screenshots
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: screenshots
|
|
|
|
path: .github/start-wasm-example/screenshot-*.png
|
2022-10-24 13:46:39 +00:00
|
|
|
|
|
|
|
build-without-default-features:
|
2023-03-07 01:37:33 +00:00
|
|
|
if: ${{ github.event_name == 'merge_group' }}
|
2023-02-01 15:08:31 +00:00
|
|
|
timeout-minutes: 30
|
2022-10-24 13:46:39 +00:00
|
|
|
strategy:
|
2023-03-07 21:42:53 +00:00
|
|
|
max-parallel: 1
|
2022-10-24 13:46:39 +00:00
|
|
|
matrix:
|
|
|
|
crate: [bevy_ecs, bevy_reflect, bevy]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-10-31 17:36:23 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2022-10-24 13:46:39 +00:00
|
|
|
- name: Install alsa and udev
|
|
|
|
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
|
|
|
|
- name: Build
|
|
|
|
run: cargo build -p ${{ matrix.crate }} --no-default-features
|
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
2023-03-07 21:42:53 +00:00
|
|
|
|
|
|
|
build-without-default-features-status:
|
|
|
|
if: |
|
|
|
|
always() &&
|
|
|
|
github.event_name == 'merge_group'
|
|
|
|
needs: build-without-default-features
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Successful
|
|
|
|
if: ${{ !(contains(needs.*.result, 'failure')) }}
|
|
|
|
run: exit 0
|
|
|
|
- name: Failing
|
|
|
|
if: ${{ contains(needs.*.result, 'failure') }}
|
|
|
|
run: exit 1
|
|
|
|
|
|
|
|
check-unused-dependencies:
|
|
|
|
if: ${{ github.event_name == 'merge_group' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-cargo-check-unused-dependencies-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
- uses: dtolnay/rust-toolchain@master
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
|
|
|
|
- name: Installs cargo-udeps
|
|
|
|
run: cargo install --force cargo-udeps
|
|
|
|
- name: Install alsa and udev
|
|
|
|
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
|
|
|
|
- name: Run cargo udeps
|
|
|
|
run: cargo udeps
|