Skip to content

Commit 86049c6

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

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 17 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,54 @@ 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

151-
- name: Create build directory
150+
- name: Build benchmark example (Unix)
151+
if: runner.os != 'Windows'
152+
run: |
153+
mkdir -p examples/google_benchmark_cmake/build
154+
cd examples/google_benchmark_cmake/build
155+
cmake -DCODSPEED_MODE=${{ matrix.codspeed-mode }} ..
156+
make -j
157+
158+
- name: Build benchmark example (Windows)
159+
if: runner.os == 'Windows'
152160
run: |
153161
if (-not (Test-Path examples\google_benchmark_cmake\build)) {
154162
mkdir examples\google_benchmark_cmake\build
155163
}
156-
shell: pwsh
157-
158-
- name: Build benchmark example
159-
run: |
160164
cd examples\google_benchmark_cmake\build
161165
cmake -DCODSPEED_MODE=${{ matrix.codspeed-mode }} ..
162166
cmake --build . --config Release
163167
shell: pwsh
164168

165-
windows-bazel-build:
169+
bazel-build:
166170
strategy:
167171
fail-fast: false
168172
matrix:
173+
os: [ubuntu-latest, windows-latest]
169174
codspeed-mode: ["off", "walltime"]
170175
bazel-version: ["7.6.2", "8.4.2", "9.0.0-pre.20250921.2"]
171-
runs-on: windows-latest
176+
runs-on: ${{ matrix.os }}
177+
env:
178+
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
172179
steps:
173180
- uses: actions/checkout@v4
174181
with:
@@ -187,6 +194,3 @@ jobs:
187194
- name: Build benchmark example
188195
run: |
189196
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)