Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Bazel CI on Windows #131

Merged
merged 1 commit into from
Jul 25, 2024
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
12 changes: 8 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Set up to use C++20.
build --cxxopt='-std=c++20'
build --cxxopt=-std=c++20

# Use the builtin crc32 for fast integer hashing.
build --copt=-mcrc32

# Enable Bzlmod for every Bazel command
common --enable_bzlmod

# Use the builtin crc32 for fast integer hashing.
build --copt=-mcrc32

# To create this file, please run:
# bazel run @com_google_fuzztest//bazel:setup_configs > fuzztest.bazelrc
try-import %workspace%/fuzztest.bazelrc

build:win_clang --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
build:win_clang --extra_execution_platforms=//:x64_windows-clang-cl
build:win_clang --compiler=clang-cl
build:win_clang --cxxopt=/std:c++20
9 changes: 7 additions & 2 deletions .github/workflows/bazel-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ jobs:
bazel_test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Test
- name: Test (Linux and Mac config)
if: runner.os != 'Windows'
run: bazel test --test_output=errors //...

- name: Test (Windows config)
if: runner.os == 'Windows'
run: bazel test --config=win_clang --test_output=errors //...
11 changes: 11 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ alias(
actual = "@com_google_googletest//:gtest",
visibility = ["//:__subpackages__"],
)

# For building with clang-cl.
# https://bazel.build/configure/windows#clang
platform(
name = "x64_windows-clang-cl",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
)