diff --git a/.forgejo/workflows/acceptance.yml b/.forgejo/workflows/acceptance.yml index 73e0d32..cc5cbb2 100644 --- a/.forgejo/workflows/acceptance.yml +++ b/.forgejo/workflows/acceptance.yml @@ -40,12 +40,15 @@ jobs: shell: bash run: | node --version && bun --version + bun install --frozen-lockfile bun tools/acceptance.ts run --runtime ${{ matrix.runtime }} --platform Linux --jobs 4 --out acceptance/Linux-${{ matrix.name }}.json - name: Acceptance matrix (Windows) if: ${{ matrix.platform == 'Windows' }} shell: pwsh run: | node --version; bun --version + bun install --frozen-lockfile + if ($LASTEXITCODE -ne 0) { throw "bun install failed" } bun tools/acceptance.ts run --runtime ${{ matrix.runtime }} --platform Windows --jobs 3 --out acceptance/Windows-${{ matrix.name }}.json if ($LASTEXITCODE -ne 0) { throw "acceptance matrix: red cells" } - uses: actions/upload-artifact@v3 diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 71bbfd7..e37e533 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -106,12 +106,17 @@ jobs: shell: bash run: | node --version && bun --version + # npm pack runs prepack, which builds the package's declarations with the pinned TypeScript + bun install --frozen-lockfile bun tools/acceptance.ts run --runtime ${{ matrix.runtime }} --platform Linux --jobs 4 --out acceptance/Linux-${{ matrix.name }}.json - name: Acceptance matrix (Windows) if: ${{ matrix.platform == 'Windows' }} shell: pwsh run: | node --version; bun --version + # npm pack runs prepack, which builds the package's declarations with the pinned TypeScript + bun install --frozen-lockfile + if ($LASTEXITCODE -ne 0) { throw "bun install failed" } bun tools/acceptance.ts run --runtime ${{ matrix.runtime }} --platform Windows --jobs 3 --out acceptance/Windows-${{ matrix.name }}.json if ($LASTEXITCODE -ne 0) { throw "acceptance matrix: red cells" } - uses: actions/upload-artifact@v3 diff --git a/tools/build-node.ts b/tools/build-node.ts index 996e32f..586d863 100644 --- a/tools/build-node.ts +++ b/tools/build-node.ts @@ -41,6 +41,7 @@ export function buildNode(out = NODE_BUNDLE): { path: string; bytes: number } { export function buildEntry(dir = join(ROOT, 'dist')): void { const types = join(dir, 'types'); rmSync(types, { recursive: true, force: true }); + if (!statSync(join(ROOT, 'node_modules', '.bin', 'tsc'), { throwIfNoEntry: false })) throw new Error('no TypeScript in node_modules: run `bun install` first (npm pack builds the declarations with it)'); const tsc = Bun.spawnSync([join(ROOT, 'node_modules', '.bin', 'tsc'), '-p', 'tsconfig.types.json', '--outDir', types], { cwd: ROOT, stdout: 'pipe', stderr: 'pipe' }); if (tsc.exitCode !== 0) throw new Error(`tsc (declarations) failed\n${tsc.stdout.toString()}${tsc.stderr.toString()}`); if (!statSync(join(types, 'lib', 'config.d.ts'), { throwIfNoEntry: false })) throw new Error('no dist/types/lib/config.d.ts');