|
1 | 1 | # CI for VS Code Extension |
2 | 2 | # ----------------------- |
3 | | -# This workflow validates Pull Requests before merging into main. |
| 3 | +# This workflow runs on Pull Requests targeting the main branch. |
| 4 | +# It ensures that the extension installs dependencies correctly |
| 5 | +# and that the TypeScript sources compile without errors. |
4 | 6 | # |
5 | | -# Design goals: |
6 | | -# - Low maintenance and low noise |
7 | | -# - Deterministic Node version via .nvmrc |
8 | | -# - pnpm-based dependency management |
9 | | -# - Compile-only check (no tests yet) |
10 | | -# |
11 | | -# This is the recommended baseline CI for a VS Code extension. |
| 7 | +# Scope: |
| 8 | +# - Node.js version is defined by .nvmrc |
| 9 | +# - Dependencies are managed with pnpm |
| 10 | +# - Only compilation is verified (no tests are executed) |
12 | 11 |
|
13 | 12 | name: CI |
14 | 13 |
|
15 | | -# Run CI only on Pull Requests targeting main |
16 | 14 | on: |
17 | 15 | pull_request: |
18 | 16 | branches: |
19 | 17 | - main |
20 | 18 |
|
21 | 19 | jobs: |
22 | 20 | compile: |
23 | | - # Ubuntu is the standard and most stable runner for VS Code extensions |
| 21 | + # Ubuntu provides a stable and widely supported environment |
| 22 | + # for building and compiling VS Code extensions. |
24 | 23 | runs-on: ubuntu-latest |
25 | 24 |
|
26 | 25 | steps: |
27 | | - # Checkout repository source code |
| 26 | + # Fetch the repository contents for the workflow run |
28 | 27 | - name: Checkout repository |
29 | 28 | uses: actions/checkout@v4 |
30 | 29 |
|
31 | | - # Setup pnpm |
32 | | - # - Installs a pinned pnpm version |
33 | | - # - Enables native pnpm store caching |
34 | | - # - More reliable on modern Ubuntu runners than setup-node caching |
| 30 | + # Install pnpm and make it available in the environment. |
| 31 | + # pnpm also manages its own dependency store cache. |
35 | 32 | - name: Setup pnpm |
36 | 33 | uses: pnpm/action-setup@v4 |
37 | 34 | with: |
38 | 35 | version: 10 |
39 | | - cache: true |
40 | 36 |
|
41 | | - # Setup Node.js runtime |
42 | | - # - Uses .nvmrc as the single source of truth |
43 | | - # - No dependency caching here (handled by pnpm) |
| 37 | + # Configure the Node.js runtime using the version |
| 38 | + # specified in the .nvmrc file. |
44 | 39 | - name: Setup Node.js |
45 | 40 | uses: actions/setup-node@v4 |
46 | 41 | with: |
47 | 42 | node-version-file: ".nvmrc" |
| 43 | + cache: "pnpm" |
| 44 | + cache-dependency-path: "pnpm-lock.yaml" |
48 | 45 |
|
49 | | - # Install dependencies |
50 | | - # - Ensures pnpm-lock.yaml is respected |
51 | | - # - Fails fast if the lockfile is out of sync |
| 46 | + # Install dependencies exactly as defined in pnpm-lock.yaml. |
| 47 | + # The workflow will fail if the lockfile and package.json |
| 48 | + # are not in sync. |
52 | 49 | - name: Install dependencies |
53 | 50 | run: pnpm install --frozen-lockfile |
54 | 51 |
|
55 | | - # Compile VS Code extension |
56 | | - # - Typically runs TypeScript compilation (tsc) |
57 | | - # - Core validation step for this project |
| 52 | + # Compile the VS Code extension. |
| 53 | + # This step typically runs the TypeScript compiler and |
| 54 | + # validates the project configuration. |
58 | 55 | - name: Compile extension |
59 | 56 | run: pnpm compile |
0 commit comments