diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index df4ba3b08..5f314db09 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -11,23 +11,10 @@ concurrency: jobs: build: - runs-on: self-hosted + # 构建检查不碰 OSS,跑在 GitHub 托管机器上,公司 runner 掉线时不阻塞 PR + runs-on: ubuntu-latest timeout-minutes: 20 steps: - # runner 到 github.com 偶发断连;先做 30 秒内的可达性探测, - # 避免 checkout 三次重试各等 2 分钟以上(一次故障白跑 7 分钟) - - name: Probe github.com egress - run: | - for i in 1 2 3; do - if curl -sS --max-time 10 -o /dev/null https://github.com; then - echo "github.com reachable (attempt $i)" - exit 0 - fi - echo "Attempt $i failed, retrying..." - sleep 5 - done - echo "::error::github.com unreachable from runner" - exit 1 - uses: actions/checkout@v5 # 只改 workflow / README / LICENSE 的 PR 不影响站点构建: # 保留 job(必需检查 build 必须上报),跳过全部重活 @@ -46,20 +33,8 @@ jobs: echo "skip=false" >> "$GITHUB_OUTPUT" echo "Source changes detected (or merge-base unavailable); running full build." fi - - name: Detect local Node.js on runner + - name: Setup Node.js if: steps.meta.outputs.skip != 'true' - id: detect_node - run: | - if command -v node >/dev/null 2>&1 && command -v npm >/dev/null 2>&1; then - echo "has_node=true" >> "$GITHUB_OUTPUT" - echo "Using local Node.js:" - node -v - npm -v - else - echo "has_node=false" >> "$GITHUB_OUTPUT" - fi - - name: Setup Node.js (fallback if runner has no Node) - if: steps.meta.outputs.skip != 'true' && steps.detect_node.outputs.has_node != 'true' uses: actions/setup-node@v5 with: node-version: '24'