Skip to content

Commit ef11ae1

Browse files
committed
fixup: run cmake/bazel on many os
1 parent a218c04 commit ef11ae1

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ jobs:
100100
runner: "codspeed-macro"
101101
- codspeed-mode: "off"
102102
runner: "ubuntu-latest"
103-
bazel-version: ["7.6.2", "8.4.2", "9.0.0-pre.20250921.2"]
104103
runs-on: ${{ matrix.runner }}
105104
steps:
106105
- uses: actions/checkout@v4
@@ -120,8 +119,6 @@ jobs:
120119
- name: Build and run benchmarks
121120
run: |
122121
bazel build //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }}
123-
env:
124-
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
125122
126123
- name: Run the benchmarks
127124
uses: CodSpeedHQ/action@main
@@ -131,44 +128,53 @@ jobs:
131128
run: bazel run //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }}
132129
token: ${{ secrets.CODSPEED_TOKEN }}
133130

134-
windows-cmake-build:
131+
cmake-build:
135132
strategy:
133+
fail-fast: false
136134
matrix:
135+
os: [ubuntu-latest, windows-latest]
137136
codspeed-mode: ["off", "walltime"]
138-
runs-on: windows-latest
137+
runs-on: ${{ matrix.os }}
139138
steps:
140139
- name: Checkout code
141-
uses: actions/checkout@v3
140+
uses: actions/checkout@v4
142141
with:
143142
submodules: "recursive"
144143

145144
- name: Cache build
146145
uses: actions/cache@v3
147146
with:
148147
path: examples/google_benchmark_cmake/build
149-
key: ${{ runner.os }}-build-${{ matrix.codspeed-mode }}-${{ hashFiles('**/CMakeLists.txt') }}
148+
key: ${{ runner.os }}-cmake-build-${{ matrix.codspeed-mode }}-${{ hashFiles('**/CMakeLists.txt') }}
150149

151150
- name: Create build directory
151+
run: mkdir -p examples/google_benchmark_cmake/build
152+
153+
- name: Build benchmark example (Unix)
154+
if: runner.os != 'Windows'
152155
run: |
153-
if (-not (Test-Path examples\google_benchmark_cmake\build)) {
154-
mkdir examples\google_benchmark_cmake\build
155-
}
156-
shell: pwsh
156+
cd examples/google_benchmark_cmake/build
157+
cmake -DCODSPEED_MODE=${{ matrix.codspeed-mode }} ..
158+
make -j
157159
158-
- name: Build benchmark example
160+
- name: Build benchmark example (Windows)
161+
if: runner.os == 'Windows'
159162
run: |
160-
cd examples\google_benchmark_cmake\build
163+
cd examples/google_benchmark_cmake/build
161164
cmake -DCODSPEED_MODE=${{ matrix.codspeed-mode }} ..
162165
cmake --build . --config Release
163166
shell: pwsh
164167

165-
windows-bazel-build:
168+
bazel-build:
166169
strategy:
167170
fail-fast: false
168171
matrix:
172+
os: [ubuntu-latest, windows-latest]
169173
codspeed-mode: ["off", "walltime"]
170174
bazel-version: ["7.6.2", "8.4.2", "9.0.0-pre.20250921.2"]
171-
runs-on: windows-latest
175+
runs-on: ${{ matrix.os }}
176+
env:
177+
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
172178
steps:
173179
- uses: actions/checkout@v4
174180
with:
@@ -187,6 +193,3 @@ jobs:
187193
- name: Build benchmark example
188194
run: |
189195
bazel build //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }}
190-
shell: pwsh
191-
env:
192-
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}

0 commit comments

Comments
 (0)