forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
797 changed files
with
46,889 additions
and
16,425 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# These are supported funding model platforms | ||
|
||
custom: https://bevyengine.org/community/donate/ | ||
custom: https://bevyengine.org/donate/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This action installs a few dependencies necessary to build Bevy on Linux. By default it installs | ||
# alsa and udev, but can be configured depending on which libraries are needed: | ||
# | ||
# ``` | ||
# - uses: ./.github/actions/install-linux-deps | ||
# with: | ||
# alsa: false | ||
# wayland: true | ||
# ``` | ||
# | ||
# See the `inputs` section for all options and their defaults. Note that you must checkout the | ||
# repository before you can use this action. | ||
# | ||
# This action will only install dependencies when the current operating system is Linux. It will do | ||
# nothing on any other OS (MacOS, Windows). | ||
|
||
name: Install Linux dependencies | ||
description: Installs the dependencies necessary to build Bevy on Linux. | ||
inputs: | ||
alsa: | ||
description: Install alsa (libasound2-dev) | ||
required: false | ||
default: true | ||
udev: | ||
description: Install udev (libudev-dev) | ||
required: false | ||
default: true | ||
wayland: | ||
description: Install Wayland (libwayland-dev) | ||
required: false | ||
default: false | ||
xkb: | ||
description: Install xkb (libxkbcommon-dev) | ||
required: false | ||
default: false | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Linux dependencies | ||
shell: bash | ||
if: ${{ runner.os == 'linux' }} | ||
run: > | ||
sudo apt-get update | ||
sudo apt-get install --no-install-recommends | ||
${{ fromJSON(inputs.alsa) && 'libasound2-dev' || '' }} | ||
${{ fromJSON(inputs.udev) && 'libudev-dev' || '' }} | ||
${{ fromJSON(inputs.wayland) && 'libwayland-dev' || '' }} | ||
${{ fromJSON(inputs.xkb) && 'libxkbcommon-dev' || '' }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,13 @@ on: | |
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
# If nightly is breaking CI, modify this variable to target a specific nightly version. | ||
NIGHTLY_TOOLCHAIN: nightly | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: ${{github.event_name == 'pull_request'}} | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
|
@@ -30,9 +35,8 @@ jobs: | |
target/ | ||
key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev | ||
if: runner.os == 'linux' | ||
- name: Install Linux dependencies | ||
uses: ./.github/actions/install-linux-deps | ||
- name: Build & run tests | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- test | ||
|
@@ -57,14 +61,18 @@ jobs: | |
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt, clippy | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
- name: Install Linux dependencies | ||
uses: ./.github/actions/install-linux-deps | ||
with: | ||
wayland: true | ||
xkb: true | ||
- name: CI job | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- lints | ||
|
||
miri: | ||
runs-on: ubuntu-latest | ||
# Explicity use MacOS 14 to take advantage of M1 chip. | ||
runs-on: macos-14 | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -81,8 +89,6 @@ jobs: | |
with: | ||
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} | ||
components: miri | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
- name: CI job | ||
# To run the tests one item at a time for troubleshooting, use | ||
# cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-permissive-provenance -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact | ||
|
@@ -116,8 +122,8 @@ jobs: | |
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev | ||
- name: Install Linux dependencies | ||
uses: ./.github/actions/install-linux-deps | ||
- name: Check Compile | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- compile | ||
|
@@ -142,8 +148,31 @@ jobs: | |
target: wasm32-unknown-unknown | ||
- name: Check wasm | ||
run: cargo check --target wasm32-unknown-unknown | ||
|
||
build-wasm-atomics: | ||
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/ | ||
target/ | ||
key: ubuntu-assets-cargo-build-wasm-nightly-${{ hashFiles('**/Cargo.toml') }} | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} | ||
targets: wasm32-unknown-unknown | ||
components: rust-src | ||
- name: Check wasm | ||
run: cargo check --target wasm32-unknown-unknown -Z build-std=std,panic_abort | ||
env: | ||
RUSTFLAGS: --cfg=web_sys_unstable_apis | ||
RUSTFLAGS: "-C target-feature=+atomics,+bulk-memory" | ||
|
||
markdownlint: | ||
runs-on: ubuntu-latest | ||
|
@@ -183,40 +212,67 @@ jobs: | |
echo 'Or if you use VSCode, use the `Even Better Toml` extension with 2 spaces' | ||
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml' | ||
run-examples-on-windows-dx12: | ||
runs-on: windows-latest | ||
timeout-minutes: 60 | ||
typos: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check for typos | ||
uses: crate-ci/[email protected] | ||
- name: Typos info | ||
if: failure() | ||
run: | | ||
echo 'To fix typos, please run `typos -w`' | ||
echo 'To check for a diff, run `typos`' | ||
echo 'You can find typos here: https://crates.io/crates/typos' | ||
echo 'if you use VSCode, you can also install `Typos Spell Checker' | ||
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode' | ||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }} | ||
run-examples-macos-metal: | ||
# Explicity use MacOS 14 to take advantage of M1 chip. | ||
runs-on: macos-14 | ||
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: Build bevy | ||
shell: bash | ||
# this uses the same command as when running the example to ensure build is reused | ||
run: | | ||
WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing" | ||
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 | ||
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 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing" | ||
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 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/ | ||
|
||
check-doc: | ||
runs-on: ubuntu-latest | ||
|
@@ -233,9 +289,11 @@ jobs: | |
target/ | ||
key: ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }} | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
if: runner.os == 'linux' | ||
- name: Install Linux dependencies | ||
uses: ./.github/actions/install-linux-deps | ||
with: | ||
wayland: true | ||
xkb: true | ||
- name: Build and check doc | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- doc | ||
|
@@ -333,14 +391,15 @@ jobs: | |
target/ | ||
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }} | ||
- name: get MSRV | ||
id: msrv | ||
run: | | ||
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'` | ||
echo "MSRV=$msrv" >> $GITHUB_ENV | ||
echo "msrv=$msrv" >> $GITHUB_OUTPUT | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.MSRV }} | ||
- name: Install alsa and udev | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev | ||
toolchain: ${{ steps.msrv.outputs.msrv }} | ||
- name: Install Linux dependencies | ||
uses: ./.github/actions/install-linux-deps | ||
- name: Run cargo check | ||
id: check | ||
run: cargo check | ||
|
@@ -375,4 +434,29 @@ jobs: | |
echo " Fix the issue by replacing 'bevy_internal' with 'bevy'" | ||
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'" | ||
exit 1 | ||
fi | ||
fi | ||
check-cfg: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }} | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} | ||
- name: Install Linux dependencies | ||
uses: ./.github/actions/install-linux-deps | ||
with: | ||
wayland: true | ||
xkb: true | ||
- name: Build and check cfg typos | ||
# See tools/ci/src/main.rs for the commands this runs | ||
run: cargo run -p ci -- cfg-check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ on: | |
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
NIGHTLY_TOOLCHAIN: nightly | ||
|
||
jobs: | ||
build-for-iOS: | ||
|
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
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
Oops, something went wrong.