Skip to content

Add CI workflow for PR checks#224

Open
jakebromberg wants to merge 6 commits intomainfrom
ci/pr-checks
Open

Add CI workflow for PR checks#224
jakebromberg wants to merge 6 commits intomainfrom
ci/pr-checks

Conversation

@jakebromberg
Copy link
Member

Summary

  • Add .nvmrc pinning Node.js to version 22
  • Add .github/workflows/ci.yml with four jobs: validate-token, build, test, and smoke-test
  • Token validation runs only on PRs and prints actionable remediation steps on failure
  • Build and test run in parallel; smoke-test reuses the build artifact to verify the wrangler dev server starts and returns HTTP 200

Closes #222

Test plan

  • Verify validate-token job runs on PR events and is skipped on push to main
  • Verify build and test jobs run in parallel after token validation
  • Verify smoke-test downloads the build artifact and asserts HTTP 200
  • Verify the workflow passes end-to-end on this PR

Jake Bromberg added 2 commits February 25, 2026 12:57
Adds CI pipeline with four jobs: validate-token (checks NPM_TOKEN
validity on PRs), build (OpenNext build with artifact upload), test
(vitest), and smoke-test (wrangler pages dev health check).
The .open-next directory starts with a dot, so upload-artifact@v4
skips it by default. Setting include-hidden-files: true fixes the
artifact upload and unblocks the smoke-test job.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 25, 2026

Deploying wxyc-dj with  Cloudflare Pages  Cloudflare Pages

Latest commit: 886abdd
Status: ✅  Deploy successful!
Preview URL: https://da61664c.dj-site.pages.dev
Branch Preview URL: https://ci-pr-checks.dj-site.pages.dev

View logs

Jake Bromberg added 4 commits February 26, 2026 15:12
Replace secrets.NPM_TOKEN (a manually-managed PAT) with
secrets.GITHUB_TOKEN which is automatically provided to workflows
and has read:packages scope for packages in the same organization.
GITHUB_TOKEN needs explicit packages:read permission to access
@wxyc/shared from GitHub Packages across repos in the organization.
The previous workflow set both NODE_AUTH_TOKEN and NPM_TOKEN env vars,
but actions/setup-node only reads NODE_AUTH_TOKEN when registry-url is
set. Simplify to use only NODE_AUTH_TOKEN with the org-level NPM_TOKEN
secret. Also add npm caching to speed up installs.

Note: GITHUB_TOKEN cannot access @wxyc/shared because the package is
private and does not grant repository access to dj-site. The NPM_TOKEN
org secret (a PAT with read:packages) is required until the package
visibility is changed or dj-site is granted access.
The project .npmrc uses ${NPM_TOKEN} for auth, which takes precedence
over the ${NODE_AUTH_TOKEN} in the setup-node temp .npmrc. Both env
vars must be set for npm to authenticate correctly.
jakebromberg pushed a commit that referenced this pull request Feb 27, 2026
The @wxyc/shared package is hosted on GitHub Packages, which requires
authentication. Add registry-url and NPM_TOKEN env vars to the CI
workflow, matching the pattern used in PR #224.
jakebromberg pushed a commit that referenced this pull request Feb 27, 2026
The @wxyc/shared package is hosted on GitHub Packages, which requires
authentication. Add registry-url and NPM_TOKEN env vars to the CI
workflow, matching the pattern used in PR #224.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI workflow for PR checks and main pushes

2 participants