Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -937,20 +937,37 @@ jobs:
# - name: Test chat-lib
# uses: ./.github/actions/test-chat-lib

# Runs on the larger runners, whose workspaces have the path of the workspace images
chat-lib-windows-tests:
name: chat-lib - Test (Windows)
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.copilot == 'true') }}
runs-on: windows-2025
runs-on: vscode-large-runners-windows-8-core
timeout-minutes: 30
# actions: read finds and downloads the workspace image (see Compile & Hygiene)
permissions:
contents: read
actions: read
env:
# The workspace image is mounted at the parent of the workspace without a drive letter, so
# esbuild needs the volume paths of pnpm's junctions (see pr-win32-test.yml)
GODEBUG: winreadlinkvolume=1
steps:
- *image-scripts
- *image-node
- *image-restore

- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# With a workspace image, keeps its untracked files, such as node_modules, and reuses its .git
clean: ${{ steps.image.outputs.used != 'true' }}

- name: Test chat-lib
uses: ./.github/actions/test-chat-lib
with:
# Installs on top of the workspace image, or everything without an image
restore-pnpm-store: 'false'

# When Compile & Hygiene finds a problem in the change, which has to be fixed and pushed again
# anyway, this job cancels the run so that the test jobs free their machines for other pull
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workspace_image/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Workspace images

Workspace images let the jobs of pull requests that install the dependencies start from a disk image of a workspace of `main` instead of an empty folder: the test jobs ([pr-linux-test.yml](../pr-linux-test.yml) and [pr-win32-test.yml](../pr-win32-test.yml)), and the Compile & Hygiene, Monaco Editor, Copilot test and Linux chat-lib test jobs of [pr.yml](../pr.yml). Its dependencies, Electron and the Playwright browsers are installed, and its `.git` holds the commit it was built at. A job mounts the image, checks out its own commit, and installs only what changed since, which for most pull requests is nothing.
Workspace images let the jobs of pull requests that install the dependencies start from a disk image of a workspace of `main` instead of an empty folder: the test jobs ([pr-linux-test.yml](../pr-linux-test.yml) and [pr-win32-test.yml](../pr-win32-test.yml)), and the Compile & Hygiene, Monaco Editor, Copilot test and chat-lib test jobs of [pr.yml](../pr.yml). Its dependencies, Electron and the Playwright browsers are installed, and its `.git` holds the commit it was built at. A job mounts the image, checks out its own commit, and installs only what changed since, which for most pull requests is nothing.

The Windows and Linux jobs that install the dependencies use the images, except two Windows jobs. The WSL smoke test job (`Windows / Electron-Smoke (WSL)`) runs on the 1ES pool and keeps its workspace on drive C: WSL cannot open folders on a volume that is mounted in a folder of drive C:. The Windows chat-lib test job (`chat-lib - Test (Windows)`) runs on a standard `windows-2025` runner. A job can only use an image on the runners that build it (`vscode-large-runners-ubuntu-8-core` and `vscode-large-runners-windows-8-core`), whose workspaces have the path of the workspace of the image. The other jobs of `pr.yml` don't install the dependencies of the workspace, so an image would only add its download: Detect Changes, Telemetry, Copilot - Check Telemetry, Ripple, the Rust jobs of [pr-linux-cli-test.yml](../pr-linux-cli-test.yml), Cancel Run and PR Gate. The macOS test jobs never adopted them, and are commented out in [pr.yml](../pr.yml) for now, like the job of [pr-workspace-images.yml](../pr-workspace-images.yml) that builds the macOS image. [What a job does](#what-a-job-does) describes the steps of a job that uses the images.
The Windows and Linux jobs that install the dependencies use the images, except the Windows WSL smoke test job (`Windows / Electron-Smoke (WSL)`), which runs on the 1ES pool and keeps its workspace on drive C: WSL cannot open folders on a volume that is mounted in a folder of drive C:. A job can only use an image on the runners that build it (`vscode-large-runners-ubuntu-8-core` and `vscode-large-runners-windows-8-core`), whose workspaces have the path of the workspace of the image. The other jobs of `pr.yml` don't install the dependencies of the workspace, so an image would only add its download: Detect Changes, Telemetry, Copilot - Check Telemetry, Ripple, the Rust jobs of [pr-linux-cli-test.yml](../pr-linux-cli-test.yml), Cancel Run and PR Gate. The macOS test jobs never adopted them, and are commented out in [pr.yml](../pr.yml) for now, like the job of [pr-workspace-images.yml](../pr-workspace-images.yml) that builds the macOS image. [What a job does](#what-a-job-does) describes the steps of a job that uses the images.

[pr-workspace-images.yml](../pr-workspace-images.yml) builds an image for Linux and Windows on the runners of the jobs every day at 05:00 UTC, and when one of its inputs changes on `main`: those of the install, of the native builds (`NATIVE_BUILD_INPUTS` in `image.ts`) and of the prepared Electron. It doesn't build them for other pushes, as the checkout of a job fetches and writes only what changed since the commit of its image. The images are kept for 2 days, so the daily build keeps a recent image available. [image.ts](image.ts) restores, checks and builds them; it has no dependencies, as the jobs run it before they check out the repository.

Expand Down
2 changes: 1 addition & 1 deletion build/lib/test/workspaceImage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ suite('workspace images', () => {
['pr-workspace-images.yml', 'windows'],
['pr-linux-test.yml', 'electron-unit-electron'],
['pr-win32-test.yml', 'electron-unit'],
...['compile', 'monaco-editor', 'copilot-check-test-cache', 'copilot-linux-tests', 'copilot-windows-tests', 'chat-lib-linux-tests'].map(job => ['pr.yml', job] as const),
...['compile', 'monaco-editor', 'copilot-check-test-cache', 'copilot-linux-tests', 'copilot-windows-tests', 'chat-lib-linux-tests', 'chat-lib-windows-tests'].map(job => ['pr.yml', job] as const),
];
const builder = download('pr-workspace-images.yml', 'linux');
assert.deepEqual(
Expand Down
Loading