Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/memory-bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: memory-bench
on:
push:
branches: [main]
paths:
- kube-runtime/**
- kube-client/**
- kube-core/**
- Cargo.toml
- Cargo.lock
pull_request:
paths:
- kube-runtime/**
- kube-client/**
- kube-core/**
- Cargo.toml
- Cargo.lock

# Spend CI time only on latest ref: https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

jobs:
memory-bench:
runs-on: ubuntu-latest
if: github.repository == 'kube-rs/kube'
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Run memory benchmark
run: cargo bench -p kube-runtime --bench memory > bench-result.json

- name: Compare benchmarks (PR)
if: github.event_name == 'pull_request'
uses: benchmark-action/github-action-benchmark@v1
with:
tool: customSmallerIsBetter
output-file-path: bench-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: bench
auto-push: false
comment-on-alert: true
alert-threshold: "110%"
fail-on-alert: true

- name: Store benchmark result (main)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: benchmark-action/github-action-benchmark@v1
with:
tool: customSmallerIsBetter
output-file-path: bench-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
gh-pages-branch: gh-pages
benchmark-data-dir-path: bench
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ tower-test = "0.4.0"
tracing = "0.1.36"
tracing-subscriber = "0.3.17"
trybuild = "1.0.48"
dhat = "0.3.3"
prettyplease = "0.2.25"
5 changes: 5 additions & 0 deletions kube-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ rand.workspace = true
schemars.workspace = true
tracing-subscriber.workspace = true
k8s-openapi= { workspace = true, features = ["latest"] }
dhat.workspace = true

[[bench]]
name = "memory"
harness = false
Loading
Loading