diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00be2b674..a89a936d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,68 +13,35 @@ env: RUSTFLAGS: "-C debuginfo=0 -D warnings" jobs: - check-lints: + checks: runs-on: ubuntu-latest + strategy: + # Default is `true` + fail-fast: false + matrix: + ci-argument: + - clippy + - compilecheck + - doccheck + - doctest + - format + - test + include: + - ci-argument: clippy + toolchain-components: clippy + - ci-argument: format + toolchain-components: rustfmt + name: CI check (${{ matrix.ci-argument }}) steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: toolchain: stable - components: rustfmt, clippy + components: ${{ matrix.toolchain-components || null }} - name: Cache Cargo build files uses: Leafwing-Studios/cargo-cache@v1.0.0 - 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 # See tools/ci/src/main.rs for the commands this runs - run: cargo run -p ci -- lints - - check-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - name: Cache Cargo build files - uses: Leafwing-Studios/cargo-cache@v1.0.0 - - name: Install alsa and udev - run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - name: Build & run tests - # See tools/ci/src/main.rs for the commands this runs - run: cargo run -p ci -- test - - check-compiles: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - name: Cache Cargo build files - uses: Leafwing-Studios/cargo-cache@v1.0.0 - - name: Install alsa and udev - run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - name: Check Compile - # See tools/ci/src/main.rs for the commands this runs - run: cargo run -p ci -- compile - - check-doc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - name: Cache Cargo build files - uses: Leafwing-Studios/cargo-cache@v1.0.0 - - 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: Build and check doc - # See tools/ci/src/main.rs for the commands this runs - run: cargo run -p ci -- doc - # - name: Installs cargo-deadlinks - # run: cargo install --force cargo-deadlinks - # - name: Checks dead links - # run: cargo deadlinks + run: cargo run -p ci -- ${{ matrix.ci-argument }} diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index af4691870..c46fe5c01 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -7,6 +7,8 @@ //! - Local runs use whatever the default Rust is locally use bevy::prelude::*; +use std::process; + use bevy::utils::HashSet; use xshell::{cmd, Shell}; @@ -89,7 +91,7 @@ fn main() { .collect::>() .join(", "), ); - return; + process::exit(1); } } else { Check::all()