Skip to content

Retain mesh and property into separate components (#410) #851

Retain mesh and property into separate components (#410)

Retain mesh and property into separate components (#410) #851

Workflow file for this run

name: CI
on:
# Run on pull requests (PR)
pull_request:
types:
# New PR
- opened
# Change pushed to source branch
- synchronize
# PR reopened
- reopened
# PR converted from Draft to Ready For Review
- ready_for_review
# Run on any new change on the main branch (CI)
push:
branches:
- main
- hotfix/*
# Enable manual trigger via GitHub UI
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
dimensions: [2d, 3d, all]
os: [windows-latest, ubuntu-latest, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Install Bevy dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev;
if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-${{ matrix.dimensions }}-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build & run lib tests (${{ matrix.dimensions }} no GPU)
run: cargo test --lib --no-default-features --features ${{ matrix.dimensions }} --features serde
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'linux' && matrix.dimensions != 'all'
- name: Build & run lib tests (${{ matrix.dimensions }} DX12)
shell: bash
run: WGPU_BACKEND=dx12 cargo test --lib --no-default-features --features ${{ matrix.dimensions }} --features serde,gpu_tests
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'windows' && matrix.dimensions != 'all'
- name: Build & run all tests (${{ matrix.dimensions }} METAL)
shell: bash
run: WGPU_BACKEND=metal cargo test --no-default-features --features ${{ matrix.dimensions }} --features serde,gpu_tests
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'macos' && matrix.dimensions != 'all'
- name: Build & run lib tests (all no GPU)
run: cargo test --lib --no-default-features --features "2d 3d serde"
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'linux' && matrix.dimensions == 'all'
- name: Build & run lib tests (all DX12)
shell: bash
run: WGPU_BACKEND=dx12 cargo test --lib --no-default-features --features "2d 3d serde gpu_tests"
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'windows' && matrix.dimensions == 'all'
- name: Build & run all tests (all METAL)
shell: bash
run: WGPU_BACKEND=metal cargo test --no-default-features --features "2d 3d serde gpu_tests"
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'macos' && matrix.dimensions == 'all'
build-wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ubuntu-cargo-build-wasm-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown --no-default-features --features 2d,3d
msrv:
runs-on: ubuntu-latest
steps:
- name: Install Bevy dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev;
if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-msrv-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.82
components: rustfmt, clippy
- name: Check
run: cargo check --lib --all-features
env:
CARGO_INCREMENTAL: 0
run-examples:
#runs-on: ubuntu-latest # Bug: Library libxkbcommon-x11.so could not be loaded.
runs-on: windows-latest
steps:
- name: Install Bevy dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev;
if: runner.os == 'linux'
# - name: Install graphic drivers
# run: |
# sudo apt-get update -y -qq
# sudo add-apt-repository ppa:kisak/kisak-mesa -y
# sudo apt-get update
# sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
# if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-all-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build & run examples (Linux)
run: |
for example in .github/example-run/3d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_window bevy/bevy_pbr bevy/bevy_ui bevy/default_font 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/3dpng/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_window bevy/bevy_pbr bevy/bevy_ui bevy/default_font bevy/png 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/2d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_window bevy/bevy_sprite bevy/bevy_ui bevy/default_font 2d serde bevy/bevy_ci_testing"
sleep 10
done
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'linux'
- name: Build & run examples (Windows)
shell: bash
run: |
for example in .github/example-run/3d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_window bevy/bevy_pbr bevy/bevy_ui bevy/default_font 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/3dpng/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_window bevy/bevy_pbr bevy/bevy_ui bevy/default_font bevy/png 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/2d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_window bevy/bevy_sprite bevy/bevy_ui bevy/default_font 2d serde bevy/bevy_ci_testing"
sleep 10
done
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'windows'
check-format:
name: Check format
runs-on: ubuntu-latest
steps:
- name: Install Bevy dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev;
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-all-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check format
run: cargo fmt --all -- --check
env:
CARGO_INCREMENTAL: 0
- name: Check lints
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
env:
CARGO_INCREMENTAL: 0
coverage:
name: Coverage
#runs-on: ubuntu-latest
runs-on: macos-14
permissions:
actions: read
checks: write
steps:
# - name: Install Bevy dependencies
# run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
# if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-all-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
# - name: Install graphic drivers
# run: |
# sudo apt-get update -y -qq
# sudo add-apt-repository ppa:kisak/kisak-mesa -y
# sudo apt-get update
# sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
# if: runner.os == 'linux'
- name: Install cargo-tarpaulin
run: |
RUST_BACKTRACE=1 cargo install --version 0.31.2 cargo-tarpaulin
- name: Generate code coverage
run: |
RUST_BACKTRACE=1 cargo tarpaulin --engine llvm --verbose --timeout 120 --out Lcov --workspace --all-features
ls -la
- name: Upload code coverage
uses: coverallsapp/github-action@master
with:
path-to-lcov: 'lcov.info'
github-token: ${{ secrets.GITHUB_TOKEN }}