Skip to content

Commit 8fceb44

Browse files
ci: add ci workflow
1 parent 2c8aa0e commit 8fceb44

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
restore-keys: |
23+
${{ runner.os }}-build-instrumentation-
24+
25+
- name: Create build directory
26+
run: mkdir -p examples/google_benchmark/build-instrumentation
27+
28+
- name: Build instrumentation benchmark example
29+
run: |
30+
cd examples/google_benchmark/build-instrumentation
31+
cmake -DCODSPEED_MODE=instrumentation ..
32+
make -j
33+
34+
- name: Run the benchmarks
35+
uses: CodSpeedHQ/action@main
36+
with:
37+
run: examples/google_benchmark/build-instrumentation/benchmark_example
38+
token: ${{ secrets.CODSPEED_TOKEN }}
39+
40+
build-walltime:
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v3
46+
47+
- name: Cache build
48+
uses: actions/cache@v3
49+
with:
50+
path: examples/google_benchmark/build-walltime
51+
key: ${{ runner.os }}-build-walltime-${{ hashFiles('**/CMakeLists.txt', '**/examples/google_benchmark/**') }}
52+
restore-keys: |
53+
${{ runner.os }}-build-walltime-
54+
55+
- name: Create build directory
56+
run: mkdir -p examples/google_benchmark/build-walltime
57+
58+
- name: Build walltime benchmark example
59+
run: |
60+
cd examples/google_benchmark/build-walltime
61+
cmake -DCODSPEED_MODE=walltime ..
62+
make -j

0 commit comments

Comments
 (0)