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.
Цей коміт міститься в:
l0ng-ai committed 2026-11-18 14:59:57 +08:00
1 джерело 36d286c5af
коміт 5e85738f2d
2 files changed
+19 -18

No files matched your search

+15
Переглянути файл
@@ -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"
+4 -18
Переглянути файл
@@ -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: |