From a64e47d772902179d02ee35a61d391fa8c071d5f Mon Sep 17 00:00:00 2001 From: Catty Steve <4795515+Catty2014@user.noreply.gitee.com> Date: Sun, 26 Apr 2026 23:27:39 +0800 Subject: [PATCH] ci(github-actions): add workshop-engine to CI matrix strategy Expand CI to run on workshop-engine crate alongside workshop-baker using a matrix strategy to avoid job duplication. --- .github/workflows/ci.yml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5b9068..4cd2f02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,27 +5,33 @@ on: branches: [ master, main ] paths: - 'workshop-baker/**' + - 'workshop-engine/**' - '.github/workflows/ci.yml' pull_request: branches: [ master, main ] paths: - 'workshop-baker/**' + - 'workshop-engine/**' - '.github/workflows/ci.yml' env: CARGO_TERM_COLOR: always jobs: - check-and-lint: - name: Check & Lint + ci: + name: ${{ matrix.crate }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + crate: [workshop-baker, workshop-engine] + defaults: run: - working-directory: ./workshop-baker + working-directory: ./${{ matrix.crate }} steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -38,19 +44,19 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ${{ matrix.crate }}/target + key: ${{ runner.os }}-cargo-${{ matrix.crate }}-${{ hashFiles(format('{0}/Cargo.lock', matrix.crate)) }} restore-keys: | - ${{ runner.os }}-cargo- + ${{ runner.os }}-cargo-${{ matrix.crate }}- + + - name: Check compilation + run: cargo check --all-features + + - name: Run tests + run: cargo test --all-features - name: Check formatting run: cargo fmt -- --check - - name: Check code (cargo check) - run: cargo check --all-features - - name: Run Clippy lints run: cargo clippy --all-features -- -D warnings - - - name: Run tests - run: cargo test --all-features