From ae2d6419fe8b25a30f79fa8bd7ff377fc2925a77 Mon Sep 17 00:00:00 2001 From: alboped Date: Sun, 5 Apr 2026 17:52:24 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BF=AE=E6=94=B9ci=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 20bbee6..362c2c7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,7 +1,8 @@ # Gitea Actions:需开启 Actions 并注册 act_runner。 -# act_runner 下 Job 容器内必须有 node(checkout/setup-node 的脚本依赖),请设置例如: -# GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:22-bookworm -# 并与本文件 runs-on、Setup Node 版本一致;需挂载 /var/run/docker.sock。 +# Runner 建议:GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:22-bookworm(Job 内自带 Node,避免 setup-node 重复下载) +# 需挂载 /var/run/docker.sock。 +# +# 说明:NODEJS_ORG_MIRROR 在 act_runner 中常被忽略/不生效;用镜像自带 Node 即可绕过。 name: CI @@ -23,13 +24,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - env: - NODEJS_ORG_MIRROR: "https://npmmirror.com/mirrors/node/" + # 使用 Job 镜像(node:22-bookworm)自带的 Node,不再使用 actions/setup-node,避免重复下载 Node + - name: Setup Yarn + run: | + npm config set registry https://registry.npmmirror.com + corepack enable + corepack prepare yarn@1.22.22 --activate + yarn --version + + - name: Cache Yarn + uses: actions/cache@v4 with: - node-version: "22" - cache: yarn + path: ~/.cache/yarn + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install run: yarn install --frozen-lockfile