From 55036e9633cbb111aac6aad6e885cb55ec9fb5ec Mon Sep 17 00:00:00 2001 From: Steve Juma Date: Wed, 28 Oct 2026 10:36:27 +0000 Subject: [PATCH] Add pull-request CI and lengthen npm verify wait Introduce a Check workflow on pull_request and main that runs the same canonical pnpm check and test:all gate used by trusted publish, so merges can require a green status. Extend the post-publish npm visibility wait from 120s to 360s after v0.2.0's registry lag failed provenance verify. --- .github/workflows/check.yml | 49 +++++++++++++++++++++++++++++++ .github/workflows/npm-publish.yml | 6 ++-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..b23c66e --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,49 @@ +name: Check + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +concurrency: + group: spec-validator-check-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + check: + name: check + runs-on: ubuntu-latest + steps: + - name: Check out the revision + uses: actions/checkout@v7 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + + - name: Set up Node.js + uses: actions/setup-node@v7 + with: + node-version: 24 + registry-url: https://registry.npmjs.org + cache: pnpm + + - name: Install pinned mdBook + uses: peaceiris/actions-mdbook@v2 + with: + mdbook-version: "0.5.2" + + - name: Install dependencies from the frozen lockfile + run: pnpm install --frozen-lockfile + + - name: Run canonical checks + run: | + pnpm run check + pnpm run test:all diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index b5965d1..290a02a 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -147,13 +147,13 @@ jobs: PACKAGE_NAME: "@lapismd/spec-validator" VERSION: ${{ needs.package-gate.outputs.version }} run: | - for attempt in $(seq 1 12); do + for attempt in $(seq 1 36); do published="$(npm view "${PACKAGE_NAME}@${VERSION}" version --registry=https://registry.npmjs.org 2>/dev/null || true)" if [ "$published" = "$VERSION" ]; then exit 0 fi - if [ "$attempt" = "12" ]; then - echo "${PACKAGE_NAME}@${VERSION} was not available from npm after 120 seconds" >&2 + if [ "$attempt" = "36" ]; then + echo "${PACKAGE_NAME}@${VERSION} was not available from npm after 360 seconds" >&2 exit 1 fi sleep 10