Repository navigation
Deploy the tested web commit and verify its public read paths #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c249b7c
Exercise the migration runner and distinguish drift from operational …
connortsui20 5840e68
Port #37's workflow changes to the bench workflows
lwwmanning 80c2936
Gate web deployments on checks for the exact deployed commit
connortsui20 450275c
Port #38's deploy verification to the bench workflows
lwwmanning 90ab898
Merge remote-tracking branch 'origin/main' into claude/port-bench-38-…
lwwmanning afa06b9
Check the exact deployed commit before a bench deploy
lwwmanning File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Bench checks | ||
| description: >- | ||
| bench's full check suite: infrastructure trust policies, format, lint, build, | ||
| the migration-runner and deployment-verification tests, and the web tests with | ||
| their Postgres integration suite. Bench CI runs it on every change to bench, | ||
| and bench-deploy runs it on the exact commit it deploys. Run it after a | ||
| checkout. | ||
|
|
||
| inputs: | ||
| pnpm-version: | ||
| description: Keep in lockstep with `packageManager` in bench/web/package.json. | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Check infrastructure trust policies offline | ||
| shell: bash | ||
| working-directory: bench | ||
| run: | | ||
| bash -n infra/provision.sh | ||
| python3 -m unittest discover -s infra/tests -v | ||
|
|
||
| # pnpm must exist before setup-node so its `cache: pnpm` can resolve the store. | ||
| - name: Install pnpm | ||
| shell: bash | ||
| env: | ||
| PNPM_VERSION: ${{ inputs.pnpm-version }} | ||
| run: npm install -g "pnpm@${PNPM_VERSION}" | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||
| with: | ||
| # The repository-wide Node pin (see CLAUDE.md "Node version"). Keep | ||
| # @types/node in bench/web/package.json on the same major. | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
| cache-dependency-path: bench/web/pnpm-lock.yaml | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| working-directory: bench/web | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Format check | ||
| shell: bash | ||
| working-directory: bench/web | ||
| run: pnpm format:check | ||
|
|
||
| - name: Lint | ||
| shell: bash | ||
| working-directory: bench/web | ||
| run: pnpm lint | ||
|
|
||
| # `next build` must succeed without a reachable database (every page and route | ||
| # is request-rendered), so no BENCH_DB_* env vars are provided here on purpose. | ||
| - name: Build | ||
| shell: bash | ||
| working-directory: bench/web | ||
| run: pnpm build | ||
|
|
||
| # testcontainers self-skips the Postgres integration suite when no Docker daemon | ||
| # is available (a local-dev convenience); in CI that would silently drop the only | ||
| # Postgres integration coverage, so fail loudly if the daemon is missing. | ||
| - name: Require Docker for the integration suite | ||
| shell: bash | ||
| run: docker info > /dev/null | ||
|
|
||
| # The migration-runner tests and the web integration suite both run | ||
| # bench/scripts/migrate-schema.py through uv. | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0 | ||
| with: | ||
| enable-cache: false | ||
|
|
||
| # uv resolves the runner's Python dependencies when it runs. Give them the | ||
| # repository's 14-day cooldown (see CLAUDE.md "Supply chain hardening"). | ||
| - name: Set the uv cooldown | ||
| shell: bash | ||
| run: echo "UV_EXCLUDE_NEWER=$(date -u -d '14 days ago' +%Y-%m-%dT%H:%M:%SZ)" >> "${GITHUB_ENV}" | ||
|
|
||
| - name: Test migration runner | ||
| shell: bash | ||
| working-directory: bench | ||
| run: uv run --no-project --with 'psycopg[binary]>=3.2' python -m unittest discover -s scripts/tests -v | ||
|
|
||
| - name: Test deployment verification | ||
| shell: bash | ||
| working-directory: bench | ||
| run: node --test scripts/tests/verify-web-deploy.test.mjs | ||
|
|
||
| - name: Test | ||
| shell: bash | ||
| working-directory: bench/web | ||
| run: pnpm test |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.