Repository navigation
Add immutable additive host instructions for fresh Freebuff conversations #10066
Workflow file for this run
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: Public CI | |
| # Build and smoke-test the exported public tree on every PR. | |
| # | |
| # This workflow was written alongside the export scripts but never reached the | |
| # public repo: it sat in scripts/public-export/github-workflows/, which neither | |
| # the manifest nor sync-public-repo.sh reads. The repo therefore had no CI at | |
| # all while CONTRIBUTING.md claimed "Public CI validates the exported public | |
| # packages". Moving it under public-export/root/ is what actually ships it. | |
| on: | |
| push: | |
| branches: [main, "fix/additive-instruction-snapshot"] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: public-ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version-file: .bun-version | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build SDK (including declarations) | |
| id: sdk | |
| continue-on-error: true | |
| run: bun run build:sdk | |
| - name: Additive instruction regression tests | |
| run: | | |
| FREEBUFF_MODE=true bun run cli/scripts/prebuild-agents.ts | |
| bun test sdk/src/__tests__/append-instructions.test.ts cli/src/utils/append-instructions.test.ts | |
| bun test cli/src/utils/append-instructions-admission.test.ts | |
| - name: Stock-source negative control for SDK composition | |
| run: | | |
| git fetch --depth=1 origin 80c2f596b5af1a331fb2904f392a8d77485eb4f2 | |
| cp sdk/src/run.ts /tmp/patched-run.ts | |
| git show 80c2f596b5af1a331fb2904f392a8d77485eb4f2:sdk/src/run.ts > sdk/src/run.ts | |
| set +e | |
| FREEBUFF_MODE=true bun run cli/scripts/prebuild-agents.ts | |
| bun test sdk/src/__tests__/append-instructions.test.ts > /tmp/negative-control.log 2>&1 | |
| result=$? | |
| set -e | |
| cp /tmp/patched-run.ts sdk/src/run.ts | |
| cat /tmp/negative-control.log | |
| test "$result" -ne 0 | |
| grep -q 'HOST_RULE_CANARY' /tmp/negative-control.log | |
| - name: Build Freebuff binary | |
| run: bun freebuff/cli/build.ts 0.0.0-ci | |
| - name: Smoke test Freebuff binary | |
| env: | |
| NEXT_PUBLIC_CB_ENVIRONMENT: prod | |
| NEXT_PUBLIC_CODEBUFF_APP_URL: https://codebuff.com | |
| NEXT_PUBLIC_SUPPORT_EMAIL: support@freebuff.com | |
| NEXT_PUBLIC_POSTHOG_API_KEY: phc_public_placeholder | |
| NEXT_PUBLIC_POSTHOG_HOST_URL: https://us.i.posthog.com | |
| NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: pk_test_placeholder | |
| NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL: https://billing.stripe.com/p/login/test | |
| NEXT_PUBLIC_WEB_PORT: '3000' | |
| run: | | |
| chmod +x cli/bin/freebuff | |
| cli/bin/freebuff --version | |
| bun cli/scripts/smoke-binary.ts cli/bin/freebuff | |
| - name: Upload exact-head Linux prerelease (not a release) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: freebuff-linux-${{ github.sha }} | |
| path: | | |
| cli/bin/freebuff | |
| cli/bin/tree-sitter.wasm | |
| retention-days: 7 | |
| - name: Preserve declaration-build failure | |
| if: steps.sdk.outcome == 'failure' | |
| run: exit 1 |