diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..ec8bd18 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,26 @@ +name: Check + +on: + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + + - run: corepack enable + + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: ".nvmrc" + cache: "pnpm" + + - run: pnpm install --frozen-lockfile + + - run: pnpm check diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0518d8f..7f6ee6f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: 24 + node-version-file: ".nvmrc" cache: "pnpm" - run: pnpm install --frozen-lockfile diff --git a/src/generators/generated-output-eq.test.ts b/src/generators/generated-output-eq.test.ts index baea74e..8af2309 100644 --- a/src/generators/generated-output-eq.test.ts +++ b/src/generators/generated-output-eq.test.ts @@ -39,11 +39,12 @@ async function normalizeContent(filePath: string, content: string) { .trim(); } -describe("Generated output parity", () => { - it("matches between base and next output folders", async () => { - expect(fs.existsSync(BASE_DIR), `${BASE_DIR} does not exist`).toBe(true); - expect(fs.existsSync(NEXT_DIR), `${NEXT_DIR} does not exist`).toBe(true); +const hasGeneratedFolders = fs.existsSync(BASE_DIR) && fs.existsSync(NEXT_DIR); +// Opt-in via `pnpm gen:verify` (or `pnpm gen:base && pnpm gen:next` first). +// Skipped in the default suite when the gitignored output folders are absent. +describe.skipIf(!hasGeneratedFolders)("Generated output parity", () => { + it("matches between base and next output folders", async () => { const baseFiles = getAllFiles(BASE_DIR); const nextFiles = getAllFiles(NEXT_DIR);