name: compat-check on: schedule: # UTC 00:00 daily = 08:00 Beijing (CST) - cron: '0 0 * * *' workflow_dispatch: {} permissions: contents: write issues: write concurrency: group: compat-check cancel-in-progress: false jobs: compat: runs-on: ubuntu-latest # Daily tier + Sunday git tier of real installs can take a while; # bound it so a wedged install cannot burn the whole 6h default. timeout-minutes: 120 steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: # Node 24 satisfies the widest engines range seen in the catalog # (some plugins require >=22.19 or >=24); DSH itself declares no engines. node-version: 24 registry-url: 'https://registry.npmjs.org' - name: Setup pnpm # dsh plugin forwards to the system pnpm binary (apps/cli/src/plugin.ts # spawns `pnpm` from PATH — "pnpm not found" would fail every layer-2 # install). Keep the same major as our local toolchain (pnpm 10). uses: pnpm/action-setup@v4 with: version: 10 - name: "Run compatibility check (layers 1-3 — static peer + real install + config assembly)" # --write persists ok/broken verdicts back into data/plugins.json. # --layers all activates layer 2 (dsh plugin add into a throwaway # profile) and layer 3 (--dump-config assembly). --scope auto selects # the frequency tiers: featured/high-star npm entries daily, the rest # of the npm entries in 5 id-hash shards (one per UTC weekday % 5 — # full coverage every 5 days), and git-source repos twice a week # (Sunday + Wednesday). Install concurrency is capped at 4 inside the # script; per-install timeouts: npm 120s, git 600s. run: node scripts/compat-check.mjs --write --layers all --scope auto - name: Regenerate README tables (compat badges changed) # Test-Runner's CI asserts README == data/plugins.json. --write flips # compat.status, which the README renders as badges, so re-run gen-readme. # (The site HTML is rebuilt by pages.yml on this commit's push — it has # no [skip ci] tag — so build.mjs is NOT needed here.) run: node scripts/gen-readme.mjs - name: Commit report and status changes run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add data/compat-report.json data/compat-installed.json data/plugins.json README.md README.en.md if git diff --cached --quiet; then echo "no change to commit" exit 0 fi git commit -m "compat: daily check $(date -u +%Y-%m-%d)" # Same race as hourly-refresh: a concurrent commit may land on main. for attempt in 1 2 3 4 5; do if git pull --rebase origin main && git push; then echo "pushed on attempt $attempt" exit 0 fi echo "push rejected (attempt $attempt) — retrying" sleep 5 done echo "push failed after 5 attempts" exit 1 # TODO(compat): open an issue via actions/github-script when any plugin # flips ok -> broken (architecture §6 step 5). Deferred until layer 2/3 # are live so the issue body can carry the failing layer's details.