ci: the acceptance jobs run bun install before packing (prepack builds the package's declarations with the pinned TypeScript; without node_modules npm pack failed and every acceptance cell went red on 5ed787a); build-node names the missing install instead of a bare ENOENT

This commit is contained in:
CRTkafa 2026-10-15 06:33:01 +08:00
parent 5ed787a8ca
commit d72b199645
3 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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');