Skip to content

Commit 113191e

Browse files
committed
feat: Add some benches and integrate with Cosdpeed
1 parent b0e6260 commit 113191e

4 files changed

Lines changed: 860 additions & 2 deletions

File tree

.github/workflows/rust.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
pull_request:
77
branches: ["main"]
88
merge_group:
9+
workflow_dispatch: # allows CodSpeed to trigger backtest performance analysis
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
@@ -30,7 +31,7 @@ jobs:
3031
tools: cargo-llvm-cov
3132
token: ${{ github.token }}
3233
- name: Run tests and determine coverage
33-
run: cargo llvm-cov test --codecov --output-path codecov.json
34+
run: cargo llvm-cov test --all-targets --codecov --output-path codecov.json
3435
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
3536
with:
3637
files: codecov.json
@@ -41,6 +42,32 @@ jobs:
4142
env:
4243
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
4344

45+
benchmarks:
46+
name: Benchmarks (${{ matrix.mode }})
47+
runs-on: ubuntu-latest
48+
permissions:
49+
contents: read
50+
id-token: write # for OpenID Connect authentication with CodSpeed
51+
strategy:
52+
matrix:
53+
mode: [simulation, memory]
54+
steps:
55+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
56+
with:
57+
persist-credentials: false
58+
- uses: mozilla/actions/rust@b6b1031d2072eb8c2b181887cb5e194ebcc5caab # v1.0.4
59+
with:
60+
tools: cargo-codspeed
61+
token: ${{ github.token }}
62+
- name: Build benchmarks
63+
run: cargo codspeed build --bench happy_eyeballs
64+
- name: Run benchmarks
65+
uses: CodSpeedHQ/action@1c8ae4843586d3ba879736b7f6b7b0c990757fab # v4.12.1
66+
with:
67+
run: cargo codspeed run
68+
mode: ${{ matrix.mode }}
69+
token: ${{ secrets.CODSPEED_TOKEN }} # zizmor: ignore[secrets-outside-env]
70+
4471
rustfmt:
4572
uses: mozilla/actions/.github/workflows/rustfmt.yml@b6b1031d2072eb8c2b181887cb5e194ebcc5caab # v1.0.4
4673

0 commit comments

Comments
 (0)