name: CI Tests on: # an unqualified `push` doubles up on every pr: pushing to a branch that has # an open pr fires both events and runs the whole matrix twice. main is the # only branch that needs a push trigger; branch work is covered by # `pull_request`, which tests the merge result rather than the branch tip. push: branches: [main] pull_request: # a newer push makes the older run worthless. main is never cancelled: those # runs are the record of what actually landed. concurrency: group: ci-tests-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: NODE_VERSION: "24" PNPM_VERSION: "10" jobs: test: name: Test (Node 24) runs-on: namespace-profile-basic steps: - name: Checkout uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: ${{ env.PNPM_VERSION }} - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile # both themes assert their built palette matches src/tokens.ts, so both # need a dist before the suite runs. the path filter picks up a new theme # without anyone having to remember this step. - name: Build required test artifacts run: pnpm --filter='./lib/theme-*' build - name: Run tests run: pnpm test build: name: Build (Node 24) runs-on: namespace-profile-basic steps: - name: Checkout uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: ${{ env.PNPM_VERSION }} - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run build run: pnpm build # everything else in the repo resolves @twinkleplop/* through the `source` # condition, straight to src/. a consumer installing from npm never does: # they get dist/ and the generated declaration bundle. an unparseable # .d.ts, a missing `types` condition or an export pointing at an # unpublished file passes `pnpm test` and breaks every consumer, so the # packed tarballs get type-checked and run on their own. - name: Check packed artifacts run: pnpm check:packed