Update to 0.16 #25
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| # Reduce compile time and cache size. | |
| RUSTFLAGS: -Dwarnings -Zshare-generics=y -Zthreads=0 -Cdebuginfo=line-tables-only | |
| RUSTDOCFLAGS: -Dwarnings -Zshare-generics=y -Zthreads=0 | |
| # Use the same Rust toolchain across jobs so they can share a cache. | |
| toolchain: nightly-2025-04-03 | |
| jobs: | |
| test: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.toolchain }} | |
| # Setting LD_LIBRARY_PATH is a workaround for <https://github.com/TheBevyFlock/bevy_new_2d/pull/318#issuecomment-2585935350>. | |
| - name: Set LD_LIBRARY_PATH | |
| run: echo "LD_LIBRARY_PATH=$(rustc --print target-libdir)" >>"${GITHUB_ENV}" | |
| - name: Restore Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: test | |
| cache-directories: ${{ env.LD_LIBRARY_PATH }} | |
| save-if: true | |
| - name: Install Bevy dependencies | |
| run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Run tests | |
| run: cargo nextest run --locked --workspace --all-targets --no-fail-fast --no-tests=warn | |
| # Running doctests separately is a workaround for <https://github.com/rust-lang/cargo/issues/6669>. | |
| - name: Run doctests | |
| run: cargo test --locked --workspace --doc --no-fail-fast | |
| # check-web: | |
| # name: Check web build | |
| # runs-on: ubuntu-latest | |
| # timeout-minutes: 20 | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v4 | |
| # | |
| # - name: Install Rust toolchain | |
| # uses: dtolnay/rust-toolchain@master | |
| # with: | |
| # toolchain: ${{ env.toolchain }} | |
| # targets: wasm32-unknown-unknown | |
| # | |
| # - name: Restore Rust cache | |
| # uses: Swatinem/rust-cache@v2 | |
| # with: | |
| # shared-key: web-dev | |
| # save-if: true | |
| # | |
| # - name: Install Bevy dependencies | |
| # run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev | |
| # | |
| # - name: Check web | |
| # run: cargo check --config 'profile.web.inherits="dev"' --no-default-features --features development --profile web --target wasm32-unknown-unknown | |
| clippy: | |
| name: Check Clippy lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.toolchain }} | |
| components: clippy | |
| - name: Restore Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: dev | |
| save-if: false | |
| - name: Install Bevy dependencies | |
| run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev | |
| - name: Run Clippy lints | |
| run: cargo clippy --locked --workspace --all-targets --all-features | |
| format: | |
| name: Check formatting | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.toolchain }} | |
| components: rustfmt | |
| - name: Run cargo fmt --check | |
| run: cargo fmt --all -- --check | |
| doc: | |
| name: Check documentation | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.toolchain }} | |
| - name: Restore Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: dev | |
| save-if: false | |
| - name: Install Bevy dependencies | |
| run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev | |
| - name: Check documentation | |
| run: cargo doc --locked --workspace --all-features --document-private-items --no-deps | |
| bevy-lint: | |
| name: Check Bevy lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain (plus bevy_lint) | |
| uses: TheBevyFlock/bevy_cli/bevy_lint@lint-v0.3.0 | |
| - name: Restore Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: dev | |
| save-if: true | |
| - name: Install Bevy dependencies | |
| run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev | |
| - name: Run Bevy lints | |
| run: bevy_lint --locked --workspace --all-targets --all-features |