From b9f3b75c95b534d6dc42dd0c1f3fa12705b4f8df Mon Sep 17 00:00:00 2001 From: Amos Lim Date: Sun, 21 Jun 2026 23:38:16 +0900 Subject: [PATCH 1/4] [CI] Add Windows build to GitHub Actions matrix Add buildtools/win (gn windows-amd64) to DEPS, run all jobs under bash, set DEPOT_TOOLS_WIN_TOOLCHAIN=0, and handle the .exe suffix so windows-latest builds and runs hello/hello_unittest. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/main.yml | 18 +++++++++++++----- DEPS | 11 +++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 462237e..9fd5de8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,14 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, macOS-latest, windows-latest] + + defaults: + run: + shell: bash + + env: + DEPOT_TOOLS_WIN_TOOLCHAIN: 0 steps: - uses: actions/checkout@v4 @@ -39,7 +46,7 @@ jobs: - name: Set up PATH run: | - echo "`pwd`/depot_tools" >> $GITHUB_PATH + echo "${{ github.workspace }}/depot_tools" >> "$GITHUB_PATH" - name: Sync run: | @@ -50,7 +57,8 @@ jobs: run: | gn gen out autoninja -C out hello - ./out/hello + ext="" + [ "$RUNNER_OS" = "Windows" ] && ext=".exe" + "./out/hello$ext" autoninja -C out hello_unittest - ./out/hello_unittest - + "./out/hello_unittest$ext" diff --git a/DEPS b/DEPS index 20cd6bb..e64bbd9 100644 --- a/DEPS +++ b/DEPS @@ -41,6 +41,17 @@ deps = { 'condition': 'host_os == "linux"', }, + 'buildtools/win': { + 'packages': [ + { + 'package': 'gn/gn/windows-amd64', + 'version': Var('gn_version'), + } + ], + 'dep_type': 'cipd', + 'condition': 'host_os == "win"', + }, + 'third_party/googletest/src': Var('chromium_git') + '/external/github.com/google/googletest.git@' + '4fe3307fb2d9f86d19777c7eb0e4809e9694dde7', From b4a59c44f516e591728b8bd01908e7f2647b607d Mon Sep 17 00:00:00 2001 From: Amos Lim Date: Sun, 21 Jun 2026 23:42:11 +0900 Subject: [PATCH 2/4] [CI] Fix Windows build: select MSVC toolchain on Windows mini_chromium emits MSVC-style flags (/W4, /Zi, /std:c++23preview) on Windows, which the gcc_like (clang++) driver rejects. Pick msvc_toolchain_$current_cpu when current_os == "win", like crashpad. Co-Authored-By: Claude Opus 4.8 --- build/BUILDCONFIG.gn | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/BUILDCONFIG.gn b/build/BUILDCONFIG.gn index 1456e6a..1f42a53 100644 --- a/build/BUILDCONFIG.gn +++ b/build/BUILDCONFIG.gn @@ -14,8 +14,13 @@ if (current_cpu == "") { current_cpu = target_cpu } -set_default_toolchain( - "//third_party/mini_chromium/src/build/config:gcc_like_toolchain") +if (current_os == "win") { + set_default_toolchain( + "//third_party/mini_chromium/src/build/config:msvc_toolchain_$current_cpu") +} else { + set_default_toolchain( + "//third_party/mini_chromium/src/build/config:gcc_like_toolchain") +} declare_args() { is_debug = true From 01d9297f963d71916ac2e87d2a470ba8a2379315 Mon Sep 17 00:00:00 2001 From: Amos Lim Date: Sun, 21 Jun 2026 23:47:47 +0900 Subject: [PATCH 3/4] [CI] Build Windows with runner MSVC (mini_chromium_is_clang=false) Pass mini_chromium_is_clang=false on Windows so the build uses the autodetected Visual Studio cl.exe and skips the clang-only flags, avoiding a large clang toolchain download. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/main.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fd5de8..521e799 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,10 +55,15 @@ jobs: - name: Build and run tests run: | - gn gen out - autoninja -C out hello + gnargs="" ext="" - [ "$RUNNER_OS" = "Windows" ] && ext=".exe" + if [ "$RUNNER_OS" = "Windows" ]; then + # Use the runner's MSVC (cl.exe) instead of fetching a clang package. + gnargs='--args=mini_chromium_is_clang=false' + ext=".exe" + fi + gn gen out $gnargs + autoninja -C out hello "./out/hello$ext" autoninja -C out hello_unittest "./out/hello_unittest$ext" From cadf53ed5b8ffc8b579d73b57a56000d4a912e95 Mon Sep 17 00:00:00 2001 From: Amos Lim Date: Sun, 21 Jun 2026 23:52:51 +0900 Subject: [PATCH 4/4] [CI] Bump actions to Node 24 versions Move checkout@v5, setup-python@v6, cache@v5 so the workflow no longer triggers the "Node.js 20 is deprecated" Actions warning. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 521e799..7f1e548 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,9 +23,9 @@ jobs: DEPOT_TOOLS_WIN_TOOLCHAIN: 0 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.10' @@ -33,7 +33,7 @@ jobs: run: | pip install setuptools - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: | .cipd/