ci(experimental): scope current tarball builds #1165
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: nestia | |
| on: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/nestia.yml" | |
| - "experimental/**" | |
| - "scripts/**" | |
| - "packages/**" | |
| - "package.json" | |
| - "pnpm-lock.yaml" | |
| - "pnpm-workspace.yaml" | |
| workflow_dispatch: | |
| concurrency: | |
| group: nestia-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| # Pack the current-platform ttsc tarballs once and share them with every | |
| # matrix job below, instead of rebuilding them six times. | |
| tarballs: | |
| runs-on: ubuntu-latest | |
| env: | |
| # Only build + pack the current platform (ttsc-linux-x64) — nestia's | |
| # overrides pull in ttsc.tgz + ttsc-linux-x64.tgz only. The full | |
| # cross-platform matrix takes ~20 min for tarballs we never consume. | |
| TTSC_TARBALLS_CURRENT: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.6.4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.x | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: packages/ttsc/go.mod | |
| cache-dependency-path: | | |
| packages/ttsc/go.sum | |
| tests/go-transformer/go.mod | |
| - name: Install ttsc dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build ttsc tarballs (current platform only) | |
| run: pnpm package:tgz | |
| - name: Upload tarballs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ttsc-tarballs | |
| path: experimental/tarballs/*.tgz | |
| if-no-files-found: error | |
| retention-days: 1 | |
| # Run nestia (next)'s standard test suite against the local ttsc tarballs | |
| # instead of the published release. | |
| nestia: | |
| needs: tarballs | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.6.4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.x | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: packages/ttsc/go.mod | |
| cache-dependency-path: | | |
| packages/ttsc/go.sum | |
| tests/go-transformer/go.mod | |
| - name: Download ttsc tarballs | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ttsc-tarballs | |
| path: experimental/tarballs | |
| - name: Clone nestia | |
| run: | | |
| rm -rf experimental/nestia | |
| git clone --depth=1 --branch next https://github.com/samchon/nestia experimental/nestia | |
| - name: Use local ttsc tarballs | |
| working-directory: experimental/nestia | |
| run: | | |
| # nestia (next) resolves ttsc through a catalog and may grow its own | |
| # top-level `overrides:` block, in which case appending a second one | |
| # makes pnpm fail with a duplicated-mapping-key YAML error (see the | |
| # typia workflow). Merge the local-tarball overrides into the existing | |
| # block instead, creating it only when absent, and no-op on re-run. | |
| node -e ' | |
| const fs = require("fs"); | |
| const file = "pnpm-workspace.yaml"; | |
| const text = fs.readFileSync(file, "utf8"); | |
| if (text.includes("file:../tarballs/ttsc.tgz")) process.exit(0); | |
| const entries = [ | |
| " ttsc: file:../tarballs/ttsc.tgz", | |
| " \"@ttsc/linux-x64\": file:../tarballs/ttsc-linux-x64.tgz", | |
| ].join("\n"); | |
| const merged = /^overrides:[ \t]*$/m.test(text) | |
| ? text.replace(/^overrides:[ \t]*$/m, (line) => line + "\n" + entries) | |
| : text.replace(/\s*$/, "") + "\n\noverrides:\n" + entries + "\n"; | |
| fs.writeFileSync(file, merged); | |
| ' | |
| - name: Install nestia dependencies | |
| working-directory: experimental/nestia | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Use System Go For Source Plugin Build | |
| run: echo "TTSC_GO_BINARY=$(go env GOROOT)/bin/go" >> "$GITHUB_ENV" | |
| - name: Build nestia | |
| working-directory: experimental/nestia | |
| env: | |
| # Mirror nestia's own test.yml: keep Node's native TS strip / module | |
| # detection off so the e2e run matches nestia's CI environment. | |
| NODE_OPTIONS: --no-experimental-strip-types --no-experimental-detect-module | |
| run: pnpm build | |
| - name: Test nestia | |
| working-directory: experimental/nestia | |
| env: | |
| NODE_OPTIONS: --no-experimental-strip-types --no-experimental-detect-module | |
| run: pnpm test |