feat(cli): add pickled build --verify-only #211
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Test | |
| run: bun test | |
| - name: Lint | |
| run: bun run lint | |
| - name: Build CLI | |
| run: bun run --cwd apps/cli build | |
| - name: Build web | |
| run: bun run --cwd apps/web build | |
| - name: CLI smoke (built artifact) | |
| run: ./apps/cli/dist/index.js --help | |
| # llms.txt has two physical copies: root (canonical, registered in | |
| # pickled.yml as a dogfood source) and apps/web/public/llms.txt (deploy | |
| # surface). They must stay in sync or pickled can pass against local | |
| # state while pickled.dev says something else. | |
| - name: Verify llms.txt sync | |
| run: diff llms.txt apps/web/public/llms.txt | |
| # Dogfood every deterministic Pickled operation against the repo's own | |
| # pickled.yml. No LLM calls, no secrets: audit scans context files, the | |
| # --plan dry-runs expand the answer/build matrices and prove both | |
| # commands are wired, test scores the offline examples, and init proves | |
| # the starter template still produces a loadable config. Real (paid, | |
| # stochastic) check/build agent runs live in the manual agent-dogfood | |
| # workflow. This block would have caught the tasks-schema drift that | |
| # silently broke the old dogfood workflows. | |
| - name: Pickled audit (dogfood) | |
| run: ./apps/cli/dist/index.js audit . --fail-on error | |
| - name: Pickled test (offline examples) | |
| run: ./apps/cli/dist/index.js test . | |
| - name: Pickled check --plan (answer tasks expand) | |
| run: ./apps/cli/dist/index.js check . --plan | |
| - name: Pickled build --plan (build tasks expand) | |
| run: ./apps/cli/dist/index.js build . --plan | |
| - name: Pickled init (starter template loads) | |
| run: | | |
| tmp="$(mktemp -d)" | |
| # The starter config registers ./README.md, so the temp project | |
| # needs one or init's own config would not load. | |
| echo "# smoke" > "$tmp/README.md" | |
| ./apps/cli/dist/index.js init "$tmp" | |
| ./apps/cli/dist/index.js check "$tmp" --plan | |
| deploy-web: | |
| needs: verify | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build web | |
| run: bun run --cwd apps/web build | |
| - name: Deploy to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy apps/web/out --project-name=pickled-web | |
| # apps/docs is deliberately built only inside this deploy job, not in the | |
| # main `verify` job above. The Fumadocs static template currently sets | |
| # `typescript.ignoreBuildErrors: true` (see apps/docs/next.config.mjs), | |
| # which means a "successful" docs build can mask real type regressions. | |
| # Until that type gap is resolved upstream, the docs build runs only on | |
| # push-to-main so it cannot pollute PR signal. The deploy still fails | |
| # loudly if next build itself throws (runtime, not type) errors. | |
| deploy-docs: | |
| needs: verify | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build docs | |
| run: bun run --cwd apps/docs build | |
| - name: Deploy to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy apps/docs/out --project-name=pickled-docs |