mirror of
https://github.com/uutils/num-prime.git
synced 2026-06-10 16:12:35 -07:00
Setup CodSpeed for continuous performance monitoring
- Replace criterion 0.3 with codspeed-criterion-compat 4.3.0 using dependency renaming (no benchmark code changes needed) - Add CodSpeed GitHub Actions workflow with OIDC authentication - Add CodSpeed badge to README
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
name: CodSpeed
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
pull_request:
|
||||
# `workflow_dispatch` allows CodSpeed to trigger backtest
|
||||
# performance analysis in order to generate initial data.
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
codspeed:
|
||||
name: Run benchmarks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup rust toolchain, cache and cargo-codspeed binary
|
||||
uses: moonrepo/setup-rust@v0
|
||||
with:
|
||||
channel: stable
|
||||
cache-target: release
|
||||
bins: cargo-codspeed
|
||||
|
||||
- name: Build the benchmark target(s)
|
||||
run: cargo codspeed build -p num-prime-bench
|
||||
|
||||
- name: Run the benchmarks
|
||||
uses: CodSpeedHQ/action@v4
|
||||
with:
|
||||
mode: simulation
|
||||
run: cargo codspeed run -p num-prime-bench
|
||||
Generated
+272
-82
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
# num-prime
|
||||
|
||||
[](https://crates.io/crates/num-prime)
|
||||
[](https://codspeed.io/uutils/num-prime?utm_source=badge)
|
||||
[](https://discord.gg/wQVJbvJ)
|
||||
[](https://github.com/uutils/num-prime/blob/main/LICENSE)
|
||||
[](https://deps.rs/repo/github/uutils/num-prime)
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ harness = false
|
||||
[dependencies]
|
||||
num-bigint = "0.4"
|
||||
num-prime = { path = ".." }
|
||||
criterion = "0.3"
|
||||
criterion = { version = "4.3.0", package = "codspeed-criterion-compat" }
|
||||
rand = "0.8"
|
||||
|
||||
num-primes = { version = "0.3.0", optional = true }
|
||||
|
||||
Reference in New Issue
Block a user