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
31 changes: 22 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,27 @@ 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
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: '3.10'

- name: Install Python setup tools
run: |
pip install setuptools

- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: |
.cipd/
Expand All @@ -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: |
Expand All @@ -48,9 +55,15 @@ jobs:

- name: Build and run tests
run: |
gn gen out
gnargs=""
ext=""
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
"./out/hello$ext"
autoninja -C out hello_unittest
./out/hello_unittest

"./out/hello_unittest$ext"
11 changes: 11 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
9 changes: 7 additions & 2 deletions build/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading