Repository navigation
experiment: plain fixture writes on Linux (do not merge) #275
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: ${{ github.ref_name != 'main' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| # ======== lint + unit tests: Linux only ======== | |
| # Nothing under test here branches on `process.platform`: the three places | |
| # that do (`detection.ts` bin names, `stacks/lint/utils.ts` platform | |
| # packages, `stacks/test/projectCoverage.ts` path casing) are only reachable | |
| # when the host *is* that platform, so a second OS would re-run identical | |
| # assertions. The Windows branches are covered by the Windows E2E job below. | |
| ut: | |
| name: UT (ubuntu-latest) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Build | |
| run: pnpm run build | |
| - name: Lint | |
| run: pnpm run lint | |
| - name: Format Check | |
| run: pnpm run fmt:check | |
| - name: Unit Test | |
| run: pnpm run test:unit | |
| # ======== E2E: Windows + macOS + Linux ======== | |
| # Windows and macOS are the platforms the extension is actually used on. | |
| # Linux is here for a different reason: rstack-ecosystem-ci runs every suite | |
| # on ubuntu-latest, so a Linux E2E run is the prerequisite for joining it | |
| # (rstackjs/rstack-editor#40). Linux needs two things the other two do not — | |
| # an X server for the Extension Host (`xvfb-run`) and the GTK/NSS/GBM/ALSA | |
| # libraries Electron links against. It also needs every fixture rewrite to | |
| # be atomic: inotify reports a truncate-then-write as two events, so a | |
| # watcher reading on the first one sees an empty file. All fixture writes go | |
| # through `e2e/shared/atomicWrite.ts`; route new ones through it too. | |
| e2e: | |
| name: E2E (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 40 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Build | |
| run: pnpm run build | |
| # Electron links against these at process start. The current | |
| # ubuntu-latest (24.04) image already carries all five — this step | |
| # installs nothing today — but the image's package set is not a contract, | |
| # and the runner images this job exists to mirror (rstack-ecosystem-ci) | |
| # need not carry them either. Naming them keeps the dependency explicit | |
| # and the job portable. The `t64` names are the Ubuntu 24.04 time_t | |
| # transition spellings — `libasound2` / `libgtk-3-0` no longer exist | |
| # there. | |
| - name: Install Extension Host Dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| libasound2t64 libgbm1 libgtk-3-0t64 libnss3 xvfb | |
| # `@vscode/test-electron` downloads a full VS Code into | |
| # `packages/vscode/.vscode-test`. Cache only the immutable distribution | |
| # directories, keyed on the extension manifest (which carries | |
| # `engines.vscode`); the restore-keys fallback keeps older downloads | |
| # available while `version: 'stable'` moves forward. | |
| - name: Cache VS Code Download | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: packages/vscode/.vscode-test/vscode-* | |
| key: vscode-test-${{ runner.os }}-${{ hashFiles('packages/vscode/package.json') }} | |
| restore-keys: | | |
| vscode-test-${{ runner.os }}- | |
| # The E2E fixtures install published npm packages at test time | |
| # (e2e/setupFixtures.mjs, invoked by test:e2e), so this step needs | |
| # network access. | |
| - name: E2E Test | |
| if: runner.os != 'Linux' | |
| run: pnpm run test:e2e | |
| # One `xvfb-run` around the whole chain: every slice launches its own VS | |
| # Code, and they must all land on the same display. | |
| - name: E2E Test (xvfb) | |
| if: runner.os == 'Linux' | |
| run: xvfb-run -a pnpm run test:e2e |