-
Notifications
You must be signed in to change notification settings - Fork 156
ci: Use codspeed for benchmarking
#3071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
de041f9
ci: Use `codspeed` for benchmarking
larseggert 478ad4d
Minimize
larseggert 8fdf449
.github/workflows/codspeed.yml
larseggert 0fa31d0
Merge branch 'main' into ci-codspeed
larseggert fdaf47f
Install cargo-codspeed
larseggert 1582a73
Fixes
larseggert 98f3e25
Fixes
larseggert b748fcd
Merge branch 'main' into ci-codspeed
larseggert bd2af17
Fixes
larseggert a4a7178
Remove comment
larseggert 62a2a61
Use different measurement modes
larseggert f22b93b
Fix
larseggert 8638d28
Update .github/workflows/codspeed.yml
larseggert d97578d
Update .github/workflows/codspeed.yml
larseggert bf7c123
Fix
larseggert 0cdb597
Shard benches
larseggert 2f72a0d
No jq
larseggert 67e2f49
Rust
larseggert 0eb9402
Update .github/workflows/codspeed.yml
larseggert 1ffe3e9
Again
larseggert 11598b9
cat
larseggert ab3a71a
Update neqo-http3/Cargo.toml
larseggert 624f7a0
Again
larseggert b24d9b2
Merge branch 'ci-codspeed' of github.com:larseggert/neqo into ci-cods…
larseggert 743369f
Again
larseggert b0a57e7
Update .github/workflows/codspeed.yml
larseggert 4633138
Fixes
larseggert ce344ef
Bump codspeed
larseggert 7fa5d75
Merge branch 'main' into ci-codspeed
larseggert 46ace57
Merge
larseggert 7aeece4
Remove FIXME
larseggert c084f2b
Merge branch 'main' into ci-codspeed
larseggert 4f9e5e6
Cargo.lock
larseggert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: CodSpeed Benchmarks | ||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["main"] | ||
| merge_group: | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref_name }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| benchmarks: | ||
| name: Run benchmarks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: ./.github/actions/rust | ||
| with: | ||
| version: stable | ||
| tools: cargo-codspeed | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - id: nss-version | ||
| run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - uses: ./.github/actions/nss | ||
| with: | ||
| minimum-version: ${{ steps.nss-version.outputs.minimum }} | ||
|
|
||
| - run: | | ||
| for crate in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].name'); do | ||
| if [ -e "$crate/benches" ]; then | ||
| for bench in "$crate/benches"/*.rs; do | ||
| bench=$(basename -s .rs "$bench") | ||
| # Set measurement mode from Cargo.toml metadata, default to "instrumentation". | ||
| mode=$(cargo metadata --no-deps --format-version 1 | jq -r --arg crate "$crate" --arg bench "$bench" '.packages[] | select(.name == $crate) | .metadata.bench[$bench].codspeed.mode // "instrumentation"') | ||
| echo "Building benchmark '$bench' in crate '$crate' with measurement mode '$mode'" | ||
| cargo codspeed build --package "$crate" --locked --features bench --bench "$bench" --release --measurement-mode "$mode" | ||
| done | ||
| fi | ||
| done | ||
|
|
||
| - name: Run the benchmarks | ||
| uses: CodSpeedHQ/action@4348f634fa7309fe23aac9502e88b999ec90a164 # v4.3.1 | ||
| with: | ||
| mode: instrumentation | ||
|
larseggert marked this conversation as resolved.
Outdated
|
||
| run: cargo codspeed run | ||
| token: ${{ secrets.CODSPEED_TOKEN }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.