Skip to content

Commit e0fab22

Browse files
SuperMuelclaude
andauthored
docs(examples): update the example workflows (#252)
Update the example workflows and the README: - Bump actions/checkout, actions/setup-python, actions/setup-node and actions/setup-go to v7, and moonrepo/setup-rust to v1. - Use Python 3.13 instead of 3.9, which is no longer supported. - Use the current macro runner label in the Go example. - Fix the README Rust workflow: `name` was directly under `jobs`, which made the workflow invalid. - Add examples for Java, Kotlin and Scala (JMH with Gradle, with actions/setup-java v6) and for CLI commands (codspeed.yml), so that examples/ covers every language of the Supported Languages docs page. - Run the JVM examples with `./gradlew jmh --no-daemon`. In walltime mode, on Linux 6.12 or later, the CodSpeed step waits for every process that the command started, and the Gradle daemon keeps running after the build. Closes COD-3885 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 78102a4 commit e0fab22

10 files changed

Lines changed: 150 additions & 19 deletions

‎README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ jobs:
145145
contents: read
146146
id-token: write # for OpenID Connect authentication with CodSpeed
147147
steps:
148-
- uses: actions/checkout@v4
149-
- uses: actions/setup-python@v3
148+
- uses: actions/checkout@v7
149+
- uses: actions/setup-python@v7
150150
with:
151-
python-version: "3.9"
151+
python-version: "3.13"
152152

153153
- name: Install dependencies
154154
run: pip install -r requirements.txt
@@ -179,17 +179,17 @@ on:
179179
workflow_dispatch:
180180

181181
jobs:
182-
name: Run benchmarks
183182
benchmarks:
183+
name: Run benchmarks
184184
runs-on: ubuntu-latest
185185
permissions: # optional for public repositories
186186
contents: read
187187
id-token: write # for OpenID Connect authentication with CodSpeed
188188
steps:
189-
- uses: actions/checkout@v4
189+
- uses: actions/checkout@v7
190190

191191
- name: Setup rust toolchain, cache and cargo-codspeed binary
192-
uses: moonrepo/setup-rust@v0
192+
uses: moonrepo/setup-rust@v1
193193
with:
194194
channel: stable
195195
cache-target: release
@@ -231,9 +231,9 @@ jobs:
231231
contents: read
232232
id-token: write # for OpenID Connect authentication with CodSpeed
233233
steps:
234-
- uses: actions/checkout@v4
234+
- uses: actions/checkout@v7
235235

236-
- uses: actions/setup-node@v3
236+
- uses: actions/setup-node@v7
237237

238238
- name: Install dependencies
239239
run: npm install

‎examples/cli-commands-codspeed.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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-arm64-graviton-ubuntu-22-04
20+
steps:
21+
- uses: actions/checkout@v7
22+
23+
# Install your toolchain and build your executable here.
24+
25+
- name: Run the benchmarks defined in codspeed.yml
26+
uses: CodSpeedHQ/action@v5
27+
with:
28+
mode: walltime
29+
# No `run` input: the action runs the benchmarks of codspeed.yml.

‎examples/cpp-cmake-codspeed.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: Run benchmarks
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v7
2222

2323
- name: Build C++ benchmarks
2424
run: |

‎examples/go-codspeed.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ permissions: # optional for public repositories
1616
jobs:
1717
codspeed:
1818
name: Run benchmarks
19-
runs-on: codspeed-macro
19+
runs-on: codspeed-macro-arm64-graviton-ubuntu-22-04
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v7
2222

2323
- name: Setup Go
24-
uses: actions/setup-go@v5
24+
uses: actions/setup-go@v7
2525
with:
2626
go-version: stable
2727

‎examples/java-gradle-codspeed.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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-arm64-graviton-ubuntu-22-04
20+
steps:
21+
- uses: actions/checkout@v7
22+
with:
23+
submodules: recursive # the CodSpeed JMH fork is a submodule
24+
25+
- uses: actions/setup-java@v6
26+
with:
27+
distribution: temurin
28+
java-version: 21
29+
30+
- name: Run Java benchmarks
31+
uses: CodSpeedHQ/action@v5
32+
with:
33+
mode: walltime # the JVM integration only supports walltime mode
34+
run: ./gradlew jmh --no-daemon # a Gradle daemon would outlive the build and keep this step waiting
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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-arm64-graviton-ubuntu-22-04
20+
steps:
21+
- uses: actions/checkout@v7
22+
with:
23+
submodules: recursive # the CodSpeed JMH fork is a submodule
24+
25+
- uses: actions/setup-java@v6
26+
with:
27+
distribution: temurin
28+
java-version: 21
29+
30+
- name: Run Kotlin benchmarks
31+
uses: CodSpeedHQ/action@v5
32+
with:
33+
mode: walltime # the JVM integration only supports walltime mode
34+
run: ./gradlew jmh --no-daemon # a Gradle daemon would outlive the build and keep this step waiting

‎examples/nodejs-typescript-codspeed.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
name: Run benchmarks
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v7
2222

23-
- uses: actions/setup-node@v3
23+
- uses: actions/setup-node@v7
2424

2525
- name: Install dependencies
2626
run: npm install

‎examples/python-pytest-codspeed.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
name: Run benchmarks
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v7
2222

23-
- uses: actions/setup-python@v3
23+
- uses: actions/setup-python@v7
2424
with:
25-
python-version: "3.9"
25+
python-version: "3.13"
2626

2727
- name: Install dependencies
2828
run: pip install -r requirements.txt

‎examples/rust-cargo-codspeed.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
name: Run benchmarks
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v7
2222

2323
- name: Setup rust toolchain, cache and cargo-codspeed binary
24-
uses: moonrepo/setup-rust@v0
24+
uses: moonrepo/setup-rust@v1
2525
with:
2626
channel: stable
2727
cache-target: release

‎examples/scala-gradle-codspeed.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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-arm64-graviton-ubuntu-22-04
20+
steps:
21+
- uses: actions/checkout@v7
22+
with:
23+
submodules: recursive # the CodSpeed JMH fork is a submodule
24+
25+
- uses: actions/setup-java@v6
26+
with:
27+
distribution: temurin
28+
java-version: 21
29+
30+
- name: Run Scala benchmarks
31+
uses: CodSpeedHQ/action@v5
32+
with:
33+
mode: walltime # the JVM integration only supports walltime mode
34+
run: ./gradlew jmh --no-daemon # a Gradle daemon would outlive the build and keep this step waiting

0 commit comments

Comments
 (0)