Skip to content

Commit 13a6cd6

Browse files
committed
docs(examples): add go and cpp examples
1 parent 346a2d8 commit 13a6cd6

File tree

5 files changed

+77
-9
lines changed

5 files changed

+77
-9
lines changed

examples/cpp-cmake-codspeed.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CodSpeed
2+
3+
on:
4+
push:
5+
branches:
6+
- "main" # or "master"
7+
pull_request: # required to have reports on PRs
8+
# `workflow_dispatch` allows CodSpeed to trigger backtest
9+
# performance analysis in order to generate initial data.
10+
workflow_dispatch:
11+
12+
permissions: # optional for public repositories
13+
contents: read
14+
id-token: write # for OpenID Connect authentication with CodSpeed
15+
16+
jobs:
17+
codspeed:
18+
name: Run benchmarks
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Build C++ benchmarks
24+
run: |
25+
mkdir -p build && cd build
26+
cmake -DCODSPEED_MODE=simulation ..
27+
make -j
28+
29+
- name: Run C++ benchmarks
30+
uses: CodSpeedHQ/action@v4
31+
with:
32+
mode: simulation
33+
run: ./path/to/built/benchmark

examples/go-codspeed.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CodSpeed
2+
3+
on:
4+
push:
5+
branches:
6+
- "main" # or "master"
7+
pull_request: # required to have reports on PRs
8+
# `workflow_dispatch` allows CodSpeed to trigger backtest
9+
# performance analysis in order to generate initial data.
10+
workflow_dispatch:
11+
12+
permissions: # optional for public repositories
13+
contents: read
14+
id-token: write # for OpenID Connect authentication with CodSpeed
15+
16+
jobs:
17+
codspeed:
18+
name: Run benchmarks
19+
runs-on: codspeed-macro
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: stable
27+
28+
- name: Run Go benchmarks
29+
uses: CodSpeedHQ/action@main
30+
with:
31+
mode: walltime # go only supports walltime mode
32+
run: go test -bench=. -benchtime=5s

examples/nodejs-typescript-codspeed.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ on:
99
# performance analysis in order to generate initial data.
1010
workflow_dispatch:
1111

12+
permissions: # optional for public repositories
13+
contents: read
14+
id-token: write # for OpenID Connect authentication with CodSpeed
15+
1216
jobs:
1317
codspeed:
1418
name: Run benchmarks
1519
runs-on: ubuntu-latest
16-
permissions: # optional for public repositories
17-
contents: read
18-
id-token: write # for OpenID Connect authentication with CodSpeed
1920
steps:
2021
- uses: actions/checkout@v4
2122

examples/python-pytest-codspeed.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ on:
99
# performance analysis in order to generate initial data.
1010
workflow_dispatch:
1111

12+
permissions: # optional for public repositories
13+
contents: read
14+
id-token: write # for OpenID Connect authentication with CodSpeed
15+
1216
jobs:
1317
codspeed:
1418
name: Run benchmarks
1519
runs-on: ubuntu-latest
16-
permissions: # optional for public repositories
17-
contents: read
18-
id-token: write # for OpenID Connect authentication with CodSpeed
1920
steps:
2021
- uses: actions/checkout@v4
2122

examples/rust-cargo-codspeed.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ on:
99
# performance analysis in order to generate initial data.
1010
workflow_dispatch:
1111

12+
permissions: # optional for public repositories
13+
contents: read
14+
id-token: write # for OpenID Connect authentication with CodSpeed
15+
1216
jobs:
1317
codspeed:
1418
name: Run benchmarks
1519
runs-on: ubuntu-latest
16-
permissions: # optional for public repositories
17-
contents: read
18-
id-token: write # for OpenID Connect authentication with CodSpeed
1920
steps:
2021
- uses: actions/checkout@v4
2122

0 commit comments

Comments
 (0)