From 1cb6e7e92f9614f8e373fb8de2da6013ea86d7ea Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 1 Oct 2026 12:50:09 +0200 Subject: [PATCH 1/3] tools: add Windows build and test workflow Run JavaScript and native tests on Windows 2025 with Clang and Temporal. Cache compiler outputs with ccache on main and pull requests targeting main, using the Visual Studio compiler selected by vcbuild. Assisted-by: pi Signed-off-by: Matteo Collina --- .github/workflows/test-windows.yml | 137 +++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 .github/workflows/test-windows.yml diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml new file mode 100644 index 000000000000..79aa2334fa34 --- /dev/null +++ b/.github/workflows/test-windows.yml @@ -0,0 +1,137 @@ +name: Test Windows + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - tools/nix/** + - typings/** + - .** + - '!.github/workflows/test-windows.yml' + push: + branches: + - main + - canary + - v[0-9]+.x-staging + - v[0-9]+.x + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - tools/nix/** + - typings/** + - .** + - '!.github/workflows/test-windows.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + PYTHON_VERSION: '3.14' + FLAKY_TESTS: keep_retrying + RUSTC_VERSION: '1.88' + CCACHE_VERSION: '4.14' + test_ci_args: --measure-flakiness 9 + +permissions: + contents: read + +jobs: + test-windows: + if: github.event.pull_request.draft == false + runs-on: windows-2025 + env: + CCACHE_BASEDIR: ${{ github.workspace }} + CCACHE_MAXSIZE: 2G + defaults: + run: + shell: cmd + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: ${{ env.PYTHON_VERSION }} + allow-prereleases: true + - name: Install NASM + run: choco install nasm --yes --no-progress + - name: Install Rust ${{ env.RUSTC_VERSION }} + run: rustup override set "%RUSTC_VERSION%" && rustup --version + - name: Set up ccache + id: ccache + if: github.base_ref == 'main' || github.ref_name == 'main' + shell: pwsh + run: | + $archive = Join-Path $env:RUNNER_TEMP 'ccache.zip' + Invoke-WebRequest "https://github.com/ccache/ccache/releases/download/v$env:CCACHE_VERSION/ccache-$env:CCACHE_VERSION-windows-x86_64.zip" -OutFile $archive + if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne '2568347a697e103ca1b073981c704ad76fb2507d066c38dba038dd73399d968f') { + throw 'ccache checksum mismatch' + } + Expand-Archive $archive -DestinationPath $env:RUNNER_TEMP + $wrapperDir = Join-Path $env:RUNNER_TEMP "ccache-$env:CCACHE_VERSION-windows-x86_64" + # vcbuild expects a compiler-masquerading executable named clang-cl.exe. + Copy-Item (Join-Path $wrapperDir 'ccache.exe') (Join-Path $wrapperDir 'clang-cl.exe') + $wrapperDir | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 + # Use the Visual Studio compiler that vcbuild selects, not a standalone LLVM installation. + $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' + $vs = & $vswhere -latest -prerelease -products * -version '[17.6,19.0)' -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.Llvm.Clang Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset -property installationPath + $compiler = Join-Path $vs 'VC\Tools\Llvm\x64\bin\clang-cl.exe' + if (-not (Test-Path $compiler)) { throw 'Visual Studio clang-cl.exe not found' } + "CCACHE_COMPILER=$compiler" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + "CCACHE_DIR=$env:RUNNER_TEMP\ccache" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + "VCBUILD_CACHE_ARGS=ccache `"$wrapperDir`"" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + - name: Restore compiler cache + if: github.base_ref == 'main' || github.ref_name == 'main' + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CCACHE_DIR }} + key: windows-2025-${{ runner.arch }}-ccache-v1-${{ env.CCACHE_VERSION }}-${{ github.sha }} + restore-keys: | + windows-2025-${{ runner.arch }}-ccache-v1-${{ env.CCACHE_VERSION }}- + - name: Build + run: vcbuild.bat clang-cl v8temporal cctest %VCBUILD_CACHE_ARGS% + - name: Show compiler cache statistics + if: always() && steps.ccache.outcome == 'success' + run: ccache --show-stats + - name: Test JavaScript + run: vcbuild.bat noprojgen nobuild test-ci-js + - name: Test native + run: vcbuild.bat noprojgen nobuild test-ci-native From 01353b7ca354fe769ca6167e0e485343589f936f Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 7 Oct 2026 06:54:30 +0000 Subject: [PATCH 2/3] tools: drop ccache caching from Windows CI Remove the ccache-based compiler cache from the Windows build and test workflow. Saving the bundled cache on every build would quickly exhaust the repository's GitHub Actions cache limits, as raised in review. Assisted-by: pi Signed-off-by: Matteo Collina --- .github/workflows/test-windows.yml | 40 +----------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 79aa2334fa34..04dc6cc3ef01 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -66,7 +66,6 @@ env: PYTHON_VERSION: '3.14' FLAKY_TESTS: keep_retrying RUSTC_VERSION: '1.88' - CCACHE_VERSION: '4.14' test_ci_args: --measure-flakiness 9 permissions: @@ -76,9 +75,6 @@ jobs: test-windows: if: github.event.pull_request.draft == false runs-on: windows-2025 - env: - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_MAXSIZE: 2G defaults: run: shell: cmd @@ -95,42 +91,8 @@ jobs: run: choco install nasm --yes --no-progress - name: Install Rust ${{ env.RUSTC_VERSION }} run: rustup override set "%RUSTC_VERSION%" && rustup --version - - name: Set up ccache - id: ccache - if: github.base_ref == 'main' || github.ref_name == 'main' - shell: pwsh - run: | - $archive = Join-Path $env:RUNNER_TEMP 'ccache.zip' - Invoke-WebRequest "https://github.com/ccache/ccache/releases/download/v$env:CCACHE_VERSION/ccache-$env:CCACHE_VERSION-windows-x86_64.zip" -OutFile $archive - if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne '2568347a697e103ca1b073981c704ad76fb2507d066c38dba038dd73399d968f') { - throw 'ccache checksum mismatch' - } - Expand-Archive $archive -DestinationPath $env:RUNNER_TEMP - $wrapperDir = Join-Path $env:RUNNER_TEMP "ccache-$env:CCACHE_VERSION-windows-x86_64" - # vcbuild expects a compiler-masquerading executable named clang-cl.exe. - Copy-Item (Join-Path $wrapperDir 'ccache.exe') (Join-Path $wrapperDir 'clang-cl.exe') - $wrapperDir | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 - # Use the Visual Studio compiler that vcbuild selects, not a standalone LLVM installation. - $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' - $vs = & $vswhere -latest -prerelease -products * -version '[17.6,19.0)' -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.Llvm.Clang Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset -property installationPath - $compiler = Join-Path $vs 'VC\Tools\Llvm\x64\bin\clang-cl.exe' - if (-not (Test-Path $compiler)) { throw 'Visual Studio clang-cl.exe not found' } - "CCACHE_COMPILER=$compiler" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 - "CCACHE_DIR=$env:RUNNER_TEMP\ccache" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 - "VCBUILD_CACHE_ARGS=ccache `"$wrapperDir`"" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 - - name: Restore compiler cache - if: github.base_ref == 'main' || github.ref_name == 'main' - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CCACHE_DIR }} - key: windows-2025-${{ runner.arch }}-ccache-v1-${{ env.CCACHE_VERSION }}-${{ github.sha }} - restore-keys: | - windows-2025-${{ runner.arch }}-ccache-v1-${{ env.CCACHE_VERSION }}- - name: Build - run: vcbuild.bat clang-cl v8temporal cctest %VCBUILD_CACHE_ARGS% - - name: Show compiler cache statistics - if: always() && steps.ccache.outcome == 'success' - run: ccache --show-stats + run: vcbuild.bat clang-cl v8temporal cctest - name: Test JavaScript run: vcbuild.bat noprojgen nobuild test-ci-js - name: Test native From 8d5d7a474ac5a0c1009630c82ba50a22e977ce81 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 8 Oct 2026 13:35:40 +0000 Subject: [PATCH 3/3] test: skip Microsoft Store bash alias on GitHub Actions The Microsoft Store app execution alias for bash.exe cannot be stat'ed or invoked reliably on GitHub Actions Windows runners, causing the test to fail in CI. Skip the bash shells discovered by `where bash` when running on GitHub Actions. Assisted-by: pi Signed-off-by: Matteo Collina --- .../parallel/test-child-process-exec-any-shells-windows.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 5c34bc77308c..0d14bd5d6cd8 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -53,9 +53,12 @@ fs.writeFile(`${tmpPath}\\test file`, 'Test', common.mustSucceed(() => { })); })); -// Test Bash (from WSL and Git), if available +// Test Bash (from WSL and Git), if available. +// The Microsoft Store app execution alias for bash.exe cannot be stat'ed or +// invoked reliably on GitHub Actions Windows runners, so skip the bash shells +// there. cp.exec('where bash', common.mustCall((error, stdout) => { - if (error) { + if (error || process.env.GITHUB_ACTIONS) { return; } const lines = stdout.trim().split(/[\r\n]+/g);