From 5e85738f2dc6d61dcd67daf806ec6dc3986dfbe5 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Wed, 18 Nov 2026 14:59:57 +0800 Subject: [PATCH] ci: run the Plugins job on the self-hosted Mac as well The persistent build output step moves into a local composite action shared by the macOS Rust job and the Plugins job. --- .github/actions/persistent-target/action.yml | 15 +++++++++++++ .github/workflows/ci.yml | 22 ++++---------------- 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 .github/actions/persistent-target/action.yml diff --git a/.github/actions/persistent-target/action.yml b/.github/actions/persistent-target/action.yml new file mode 100644 index 0000000000..467f68d274 --- /dev/null +++ b/.github/actions/persistent-target/action.yml @@ -0,0 +1,15 @@ +name: Persistent build output +description: >- + On a self-hosted runner, point CARGO_TARGET_DIR at a directory outside the workspace + (checkout cleans ignored files) that persists between runs, in place of a restored cache. + A runner takes one job at a time, so each job's directory has a single user. +runs: + using: composite + steps: + - if: runner.environment == 'self-hosted' + shell: bash + run: | + dir="$HOME/.cache/openidea-ci/target-$GITHUB_JOB" + # Start over once it grows past 60 GB. + if [ -d "$dir" ] && [ "$(du -sk "$dir" | cut -f1)" -gt 62914560 ]; then rm -rf "$dir"; fi + echo "CARGO_TARGET_DIR=$dir" >> "$GITHUB_ENV" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66a5d5442e..c59a79c33d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,16 +77,7 @@ jobs: runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v5 - # Checkout cleans ignored files, so a self-hosted runner builds outside the workspace and - # keeps that output instead of a restored cache. One job at a time per runner: no sharing. - - name: Persistent build output - if: runner.environment == 'self-hosted' - shell: bash - run: | - dir="$HOME/.cache/openidea-ci/target-$GITHUB_JOB" - # Start over once it grows past 60 GB. - if [ -d "$dir" ] && [ "$(du -sk "$dir" | cut -f1)" -gt 62914560 ]; then rm -rf "$dir"; fi - echo "CARGO_TARGET_DIR=$dir" >> "$GITHUB_ENV" + - uses: ./.github/actions/persistent-target - uses: pnpm/action-setup@v5 with: { version: 11 } - uses: actions/setup-node@v5 @@ -146,18 +137,13 @@ jobs: needs: changes if: needs.changes.outputs.rust == 'true' timeout-minutes: 30 - runs-on: ubuntu-22.04 - env: - CARGO_TARGET_DIR: ${{ github.workspace }}/target-plugins + # Rust and Node only: the self-hosted Mac, building incrementally on its persisted output. + runs-on: [self-hosted, macOS, ARM64] steps: - uses: actions/checkout@v5 + - uses: ./.github/actions/persistent-target - uses: dtolnay/rust-toolchain@stable with: { targets: wasm32-wasip2, components: "clippy, rustfmt" } - - uses: Swatinem/rust-cache@v2 - with: - key: plugins - cache-directories: target-plugins - save-if: ${{ github.ref == 'refs/heads/main' }} - name: Format, lint (host and wasm) and test each crate shell: bash run: |