Skip to content

Event refactor

Event refactor #917

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- 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: Run cargo clippy
run: cargo clippy --workspace --all-features --tests --examples --exclude yarnspinner_without_bevy_examples -- --deny warnings
- name: Run cargo clippy for non-bevy
run: cargo clippy --no-default-features --tests -p yarnspinner -p yarnspinner_without_bevy_examples -- --deny warnings
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
doc:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- 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: Run cargo doc
run: cargo doc --no-deps --workspace --all-features --exclude yarnspinner_without_bevy_examples
- name: Run cargo doc for non-bevy
run: cargo doc --no-default-features --no-deps -p yarnspinner -p yarnspinner_without_bevy_examples
test-bevy:
name: Test with Bevy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- 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: Run cargo test
run: |
LD_LIBRARY_PATH="$(rustc --print target-libdir)" \
cargo test --workspace --features=bevy/dynamic_linking \
--lib --bins --tests --examples \
--exclude yarnspinner_without_bevy_examples
test-bevy-docs:
name: Test Docs with Bevy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- 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: Run doc tests
run: |
LD_LIBRARY_PATH="$(rustc --print target-libdir)" \
cargo test --workspace --all-features --doc \
--features=bevy/dynamic_linking \
--exclude yarnspinner_without_bevy_examples
test-without-bevy:
name: Test without Bevy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- 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: Run cargo test for non-bevy
run: cargo test --no-default-features -p yarnspinner -p yarnspinner_without_bevy_examples
- name: Run doc tests for non-bevy
run: LD_LIBRARY_PATH="$(rustc --print target-libdir)" cargo test --doc --no-default-features -p yarnspinner -p yarnspinner_without_bevy_examples
build-web:
name: Build demo for web
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install Bevy CLI
run: cargo install --git=https://github.com/TheBevyFlock/bevy_cli --locked bevy_cli
- name: Build for web
run: |
cd demo
bevy build --locked --all-targets --yes -p bevy_yarnspinner_demo web