Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E tests for bevy build #222

Merged
merged 5 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/actions/install-linux-deps/action.yml
TimJentzsch marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 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).
#
# Adopted from the Bevy repository: https://github.com/bevyengine/bevy/blob/main/.github/workflows/ci.yml

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' || '' }}
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
with:
sweep-cache: true

- name: Install Linux dependencies for Bevy
uses: ./.github/actions/install-linux-deps

- name: Run tests
run: |
cargo test --workspace --all-features --all-targets
Expand All @@ -54,7 +57,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ needs.extract-rust-version.outputs.channel }}
components: '${{ needs.extract-rust-version.outputs.components }}, clippy'
components: "${{ needs.extract-rust-version.outputs.components }}, clippy"

- name: Cache build artifacts
uses: Leafwing-Studios/cargo-cache@v2
Expand All @@ -76,7 +79,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ needs.extract-rust-version.outputs.channel }}
components: '${{ needs.extract-rust-version.outputs.components }}, rustfmt'
components: "${{ needs.extract-rust-version.outputs.components }}, rustfmt"

- name: Run rustfmt
run: cargo fmt --all --check
Expand Down
68 changes: 68 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ wasm-opt = { version = "0.116.1", optional = true }
# We don't use `cc` directly, but our dependency `wasm-opt-sys` fails to compile on Windows when using a newer version.
# This can be removed when https://github.com/rust-lang/cc-rs/issues/1324 is fixed.
cc = "=1.2.2"

[dev-dependencies]
# Forcing tests that can't be parallelized to be run sequentially
serial_test = "3.2.0"
Loading
Loading