Skip to content

Commit 4601025

Browse files
ci: add ci workflow
1 parent 2c8aa0e commit 4601025

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
instrumentation:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Cache build
18+
uses: actions/cache@v3
19+
with:
20+
path: examples/google_benchmark/build-instrumentation
21+
key: ${{ runner.os }}-build-instrumentation-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark/**') }}
22+
23+
- name: Create build directory
24+
run: mkdir -p examples/google_benchmark/build-instrumentation
25+
26+
- name: Build instrumentation benchmark example
27+
run: |
28+
cd examples/google_benchmark/build-instrumentation
29+
cmake -DCODSPEED_MODE=instrumentation ..
30+
make -j
31+
32+
- name: Run the benchmarks
33+
uses: CodSpeedHQ/action@main
34+
with:
35+
run: examples/google_benchmark/build-instrumentation/benchmark_example
36+
token: ${{ secrets.CODSPEED_TOKEN }}
37+
38+
build-walltime:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v3
44+
45+
- name: Cache build
46+
uses: actions/cache@v3
47+
with:
48+
path: examples/google_benchmark/build-walltime
49+
key: ${{ runner.os }}-build-walltime-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark/**') }}
50+
51+
- name: Create build directory
52+
run: mkdir -p examples/google_benchmark/build-walltime
53+
54+
- name: Build walltime benchmark example
55+
run: |
56+
cd examples/google_benchmark/build-walltime
57+
cmake -DCODSPEED_MODE=walltime ..
58+
make -j

0 commit comments

Comments
 (0)