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
60 changes: 58 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
make -j

- name: Run tests
run: |
run: |
cd core/build-tests
GTEST_OUTPUT=json:test-results/ ctest

Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
- name: Build benchmark example
run: |
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on

- name: Run the benchmarks
uses: CodSpeedHQ/action@main
if: matrix.codspeed-mode != 'off'
Expand Down Expand Up @@ -207,3 +207,59 @@ jobs:
- name: Build benchmark example
run: |
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on

macos-walltime-cmake-test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Build benchmark example
run: |
mkdir -p examples/google_benchmark_cmake/build
cd examples/google_benchmark_cmake/build
cmake -DCODSPEED_MODE=walltime ..
make -j

- name: Run the benchmarks
uses: CodSpeedHQ/action@main
env:
CODSPEED_SKIP_UPLOAD: "true"
with:
run: examples/google_benchmark_cmake/build/benchmark_example --benchmark_filter=Fibo
mode: walltime
# TODO: Drop this
runner-version: branch:cod-2459-be-able-to-run-all-integrations-on-macos

macos-walltime-bazel-test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Set up Bazel
uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Build benchmark example
run: |
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=walltime --@codspeed_core//:strict_warnings=on

- name: Run the benchmarks
uses: CodSpeedHQ/action@main
env:
CODSPEED_SKIP_UPLOAD: "true"
with:
# Note: using bazel run directly fails with a permission error on `/var/tmp/_bazel_codspeed/`
# This is because bazel does not like the user switch between running `bazel build` as a user then running `bazel run` as sudo and refuses to run.
# For now, `$USER` remains the original user, but the program is ran with uid 0 with `sudo --preserve-env`
# This problem is temporary because the runner does not YET do the same uid/gid spoofing on macos as it does on linux.
run: ./bazel-bin/examples/google_benchmark_bazel/my_benchmark --benchmark_filter=Fibo
mode: walltime
# TODO: Drop this
runner-version: branch:cod-2459-be-able-to-run-all-integrations-on-macos
8 changes: 8 additions & 0 deletions core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ config_setting(
constraint_values = ["@platforms//os:windows"],
)

config_setting(
name = "macos",
constraint_values = ["@platforms//os:macos"],
)

# Strict warnings mode
string_flag(
name = "strict_warnings",
Expand Down Expand Up @@ -100,6 +105,9 @@ cc_library(
copts = select({
":windows": ["/std:c++17"],
"//conditions:default": ["-std=c++17"],
}) + select({
":macos": ["-mmacosx-version-min=10.15"],
"//conditions:default": [],
}),
defines = [
"CODSPEED_VERSION=\\\"{}\\\"".format(CODSPEED_VERSION),
Expand Down
2 changes: 1 addition & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include(FetchContent)
FetchContent_Declare(
instrument_hooks_repo
GIT_REPOSITORY https://github.com/CodSpeedHQ/instrument-hooks
GIT_TAG 0c971823b17cb5a3bbd0cce4411cbee2c6fe4317
GIT_TAG 4376be3e1e2d0e0c82d690bcb8e54bde98b7805c
)
FetchContent_MakeAvailable(instrument_hooks_repo)
FetchContent_GetProperties(instrument_hooks_repo)
Expand Down
2 changes: 1 addition & 1 deletion core/include/measurement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ALWAYS_INLINE void measurement_stop() {
}

ALWAYS_INLINE void measurement_set_executed_benchmark(const std::string& name) {
auto current_pid = getpid();
auto current_pid = static_cast<uint32_t>(getpid());
instrument_hooks_executed_benchmark(g_hooks, current_pid, name.c_str());
}

Expand Down
2 changes: 1 addition & 1 deletion core/instrument-hooks
Loading