fix(ci): Preflight 改为 Gitea 标准 container:image 写法(runs-on 只填 ubuntu-latest,避免 no runner matched)
This commit is contained in:
@@ -39,25 +39,30 @@ jobs:
|
||||
# ============================================================
|
||||
preflight:
|
||||
name: Preflight 语法 & 构建检查
|
||||
# 国内访问 GitHub actions/node-versions release 经常超时(443 ETIMEDOUT)
|
||||
# 所以直接用官方 node:22 镜像跑这个 Job,绕过 setup-node 下载 step
|
||||
runs-on: [ubuntu-latest:docker://node:22-bookworm-slim]
|
||||
# ⚠️ Gitea/act_runner 的写法:runs-on 只填注册时的真实标签(我们叫 ubuntu-latest);
|
||||
# 如果要强制用某个 Docker 镜像跑这个 Job,单独写一个 container: 段。
|
||||
# 不能写 "ubuntu-latest:docker://xxx",这是 GitHub Actions 专有语法,Gitea 不认!
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
# 直接用官方 node:22 镜像当 Job 容器(里面自带 node 22 + npm),
|
||||
# 完全绕过 setup-node 从 GitHub release 下载 node tar.gz 的国内超时老坑
|
||||
container:
|
||||
image: node:22-bookworm-slim
|
||||
steps:
|
||||
- name: 📥 Checkout 代码
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
# ── 我们已经用 runs-on: docker://node:22 了,所以这里不需要 actions/setup-node ──
|
||||
# 避免国内 Runner 从 github.com 下载 Node tar.gz 出现 ETIMEDOUT
|
||||
- name: 🔎 环境自检(node/npm 版本)
|
||||
# ── 已经在 container.image=node:22 里跑了,自带 node 22,不需要 actions/setup-node ──
|
||||
- name: 🔎 环境自检(确认容器里有 node/npm,版本对得上)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
node -v
|
||||
npm -v
|
||||
which node npm
|
||||
cat /etc/os-release 2>/dev/null | head -4 || true
|
||||
|
||||
- name: 🧪 安装依赖(npm ci,严格按锁文件)
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user