Skip to content

Commit a0de2ac

Browse files
ci: add macos integration test
1 parent d10dfe3 commit a0de2ac

1 file changed

Lines changed: 54 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
make -j
5151
5252
- name: Run tests
53-
run: |
53+
run: |
5454
cd core/build-tests
5555
GTEST_OUTPUT=json:test-results/ ctest
5656
@@ -133,7 +133,7 @@ jobs:
133133
- name: Build benchmark example
134134
run: |
135135
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on
136-
136+
137137
- name: Run the benchmarks
138138
uses: CodSpeedHQ/action@main
139139
if: matrix.codspeed-mode != 'off'
@@ -207,3 +207,55 @@ jobs:
207207
- name: Build benchmark example
208208
run: |
209209
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=${{ matrix.codspeed-mode }} --@codspeed_core//:strict_warnings=on
210+
211+
macos-walltime-cmake-test:
212+
runs-on: macos-latest
213+
steps:
214+
- uses: actions/checkout@v4
215+
with:
216+
submodules: "recursive"
217+
218+
- name: Build benchmark example
219+
run: |
220+
mkdir -p examples/google_benchmark_cmake/build
221+
cd examples/google_benchmark_cmake/build
222+
cmake -DCODSPEED_MODE=walltime ..
223+
make -j
224+
225+
- name: Run the benchmarks
226+
uses: CodSpeedHQ/action@main
227+
env:
228+
CODSPEED_SKIP_UPLOAD: "true"
229+
with:
230+
run: examples/google_benchmark_cmake/build/benchmark_example --benchmark_filter=Fibo
231+
mode: walltime
232+
233+
macos-walltime-bazel-test:
234+
runs-on: macos-latest
235+
steps:
236+
- uses: actions/checkout@v4
237+
with:
238+
submodules: "recursive"
239+
240+
- name: Set up Bazel
241+
uses: bazel-contrib/setup-bazel@0.14.0
242+
with:
243+
bazelisk-cache: true
244+
disk-cache: ${{ github.workflow }}
245+
repository-cache: true
246+
247+
- name: Build benchmark example
248+
run: |
249+
bazel build //examples/google_benchmark_bazel:my_benchmark --@codspeed_core//:codspeed_mode=walltime --@codspeed_core//:strict_warnings=on
250+
251+
- name: Run the benchmarks
252+
uses: CodSpeedHQ/action@main
253+
env:
254+
CODSPEED_SKIP_UPLOAD: "true"
255+
with:
256+
# Note: using bazel run directly fails with a permission error on `/var/tmp/_bazel_codspeed/`
257+
# 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.
258+
# For now, `$USER` remains the original user, but the program is ran with uid 0 with `sudo --preserve-env`
259+
# This problem is temporary because the runner does not YET do the same uid/gid spoofing on macos as it does on linux.
260+
run: ./bazel-bin/examples/google_benchmark_bazel/my_benchmark --benchmark_filter=Fibo
261+
mode: walltime

0 commit comments

Comments
 (0)