|
| 1 | +name: VS Code Extension CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - "frontend/vscode-extension/**" |
| 7 | + - ".github/workflows/vscode-extension-ci.yml" |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: vscode-extension-ci-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + name: Typecheck, build and package |
| 19 | + runs-on: ubuntu-latest |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 24 | + |
| 25 | + - name: Setup Node.js |
| 26 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
| 27 | + with: |
| 28 | + node-version: "24" |
| 29 | + |
| 30 | + - name: Setup pnpm |
| 31 | + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 |
| 32 | + with: |
| 33 | + version: 10 |
| 34 | + run_install: false |
| 35 | + |
| 36 | + - name: Get pnpm store directory |
| 37 | + shell: bash |
| 38 | + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 39 | + |
| 40 | + - name: Cache pnpm store |
| 41 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 42 | + with: |
| 43 | + path: ${{ env.STORE_PATH }} |
| 44 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('frontend/vscode-extension/pnpm-lock.yaml') }} |
| 45 | + restore-keys: | |
| 46 | + ${{ runner.os }}-pnpm-store- |
| 47 | +
|
| 48 | + - name: Install dependencies |
| 49 | + working-directory: frontend/vscode-extension |
| 50 | + run: pnpm install --frozen-lockfile |
| 51 | + |
| 52 | + - name: Typecheck |
| 53 | + working-directory: frontend/vscode-extension |
| 54 | + run: pnpm run typecheck |
| 55 | + |
| 56 | + - name: Build |
| 57 | + working-directory: frontend/vscode-extension |
| 58 | + run: pnpm build:prod |
| 59 | + |
| 60 | + # Runs `vsce package`, which is where packaging/toolchain issues surface |
| 61 | + # (e.g. an incompatible minimatch resolution) that the build alone misses. |
| 62 | + - name: Package |
| 63 | + working-directory: frontend/vscode-extension |
| 64 | + run: pnpm package --out hatchet-ci.vsix |
0 commit comments