Skip to content

Reimplement Runs, Levels, and Phases #94

Reimplement Runs, Levels, and Phases

Reimplement Runs, Levels, and Phases #94

Workflow file for this run

name: CI
on:
pull_request:
env:
RUST_BACKTRACE: 1
jobs:
ci-pass:
name: CI is green
runs-on: ubuntu-latest
needs:
- style
- test
steps:
- run: exit 0
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install bevy deps
run: |
set -euxo pipefail
sudo apt install -y lld g++ pkg-config libx11-dev libasound2-dev libudev-dev
- name: Cache deps
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: cargo fmt -- --check
run: cargo fmt -- --check
- name: temporary workaround - fmt all files under src
# Workaround for rust-lang/cargo#7732
run: cargo fmt -- --check $(find . -name '*.rs' -print)
- name: Check that the game compiles and is minimally sensible rust (no warnings)
run: cargo rustc --all-features -- -D warnings
test:
name: ${{ matrix.name }}
needs: [style]
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
matrix:
name:
- linux / nightly
- macOS / nightly
- windows / nightly
include:
- name: linux / nightly
rust: nightly
os: ubuntu-latest
- name: macOS / nightly
os: macOS-latest
rust: nightly
- name: windows / nightly
os: windows-latest
rust: nightly
target: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install bevy deps
if: matrix.os == 'ubuntu-latest'
run: |
set -euxo pipefail
sudo apt install -y lld g++ pkg-config libx11-dev libasound2-dev libudev-dev
shell: bash
- name: Cache deps
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{ matrix.rust || 'stable' }}
targets: ${{ matrix.target }}
- name: Create Cargo.lock
run: cargo update
- name: Run tests
run: |
set -euxo pipefail
cargo check --tests
cargo test --all-features --workspace
shell: bash