Skip to content

Commit 11f563e

Browse files
ci: add ci workflow
1 parent 0e27a80 commit 11f563e

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/ci.yml

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

0 commit comments

Comments
 (0)