Skip to content
Open
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
47 changes: 41 additions & 6 deletions .github/workflows/bazel_test_centipede.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
# TODO(xinhaoyuan): Bump to 24.04 after https://github.com/llvm/llvm-project/issues/102443
# is fixed.
runs-on: ubuntu-22.04
permissions:
contents: read
timeout-minutes: 60
strategy:
matrix:
Expand All @@ -39,13 +41,13 @@ jobs:
run: |
sudo sysctl -w kernel.core_pattern=""
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -yq \
clang llvm libssl-dev
- name: Restore latest cache
uses: actions/cache/restore@v4
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-${{ matrix.config }}
Expand Down Expand Up @@ -84,19 +86,21 @@ jobs:
bazel test --no//fuzztest:use_riegeli --test_output=errors --linkopt=-fsanitize=address --copt=-fsanitize=address --test_env=ASAN_OPTIONS=detect_leaks=0 --platform_suffix=asan --test_timeout=600 centipede/puzzles:all
- name: Save new cache based on main
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-${{ matrix.config }}-${{ github.run_id }}
run_tests_mac:
name: Run Centipede tests (MacOS)
runs-on: macos-15
permissions:
contents: read
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Restore latest cache
uses: actions/cache/restore@v4
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-mac
Expand Down Expand Up @@ -127,7 +131,38 @@ jobs:
bazel --output_user_root="${HOME}/.cache/bazel" test --test_output=errors --no//fuzztest:use_riegeli --linkopt=-fsanitize=address --copt=-fsanitize=address --test_env=ASAN_OPTIONS=detect_leaks=0 --platform_suffix=asan --test_timeout=600 centipede/puzzles:all
- name: Save new cache based on main
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-mac-${{ github.run_id }}
run_tests_win:
name: Run Centipede tests (Windows)
runs-on: windows-latest
permissions:
contents: read
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Restore latest cache
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-win-${{ matrix.config }}
restore-keys: bazel-centipede-cache-win-${{ matrix.config }}-
- name: Set environment variable
run: echo "USE_BAZEL_VERSION=8.7.0" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Run unit tests
if: ${{ !cancelled() }}
run: |
<# Only supported libraries are tested here. #> `
bazelisk test --disk_cache=~/.cache/bazel --local_test_jobs=1 --test_output=errors --no//fuzztest:use_riegeli `
--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl `
--extra_execution_platforms=//:x64_windows-clang-cl --enable_runfiles `
-- centipede:util_test centipede:command_test
- name: Save new cache based on main
# if: github.ref == 'refs/heads/main'
uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-win-${{ github.run_id }}
8 changes: 8 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
platform(
name = "x64_windows-clang-cl",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
)
4 changes: 4 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ bazel_dep(
name = "rules_cc",
version = "0.2.17",
)

cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
use_repo(cc_configure, "local_config_cc")

bazel_dep(
name = "rules_shell",
version = "0.6.1",
Expand Down
17 changes: 14 additions & 3 deletions centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,16 @@ cc_library(
":stop",
":util",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/hash",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@abseil-cpp//absl/synchronization",
"@abseil-cpp//absl/time",
"@com_google_fuzztest//common:logging",
"@com_google_fuzztest//fuzztest/internal:escaping",
],
)

Expand Down Expand Up @@ -1413,7 +1416,12 @@ cc_test(
cc_test(
name = "util_test",
srcs = ["util_test.cc"],
copts = ["-fno-signed-char"],
copts = select({
"@platforms//os:windows": [
"/J",
],
"//conditions:default": ["-fno-signed-char"],
}),
deps = [
":feature",
":thread_pool",
Expand Down Expand Up @@ -1740,10 +1748,13 @@ cc_binary(
name = "command_test_helper",
srcs = ["command_test_helper.cc"],
deps = [
":runner_fork_server",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/time",
],
] + select({
"@platforms//os:windows": [],
"//conditions:default": [":runner_fork_server"],
}),
)

cc_test(
Expand Down
Loading
Loading