nightly-bench #98
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
| name: nightly-bench | |
| on: | |
| schedule: | |
| - cron: "30 6 * * *" # daily at 06:30 UTC | |
| workflow_dispatch: | |
| # Deny-all by default; each job re-grants only what it needs. | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| bench: | |
| name: criterion benches | |
| # TODO(infra): pin to a self-hosted quiet runner (label | |
| # `aether-bench-runner`) for stable numbers. Until then, use | |
| # ubuntu-latest and treat the numbers as directional only — github | |
| # runners have noisy neighbors and can swing 30%+ between runs. | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| permissions: | |
| contents: write # for publishing to gh-pages | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # v1 | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@258712b0b7b1ddf8bddc9fc3b0faca682b2736c3 # v2 | |
| with: | |
| key: bench | |
| - name: Run criterion (full) | |
| run: cargo bench --workspace --no-fail-fast -- --noplot | |
| env: | |
| # Match the CI rust matrix's RUSTFLAGS so numbers compare apples | |
| # to apples with PR-time builds. | |
| RUSTFLAGS: "-C target-cpu=native" | |
| - name: Collect criterion JSON | |
| run: | | |
| mkdir -p bench-output | |
| find target/criterion -name 'estimates.json' -print | while read -r p; do | |
| rel=${p#target/criterion/} | |
| out="bench-output/${rel}" | |
| mkdir -p "$(dirname "$out")" | |
| cp "$p" "$out" | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: criterion-${{ github.run_id }} | |
| path: bench-output | |
| retention-days: 30 | |
| # TODO(infra): wire `benchmark-action/github-action-benchmark` to | |
| # publish a tracking dashboard to gh-pages. Skeleton wiring: | |
| # | |
| # - uses: benchmark-action/github-action-benchmark@v1 | |
| # with: | |
| # tool: 'cargo' | |
| # output-file-path: bench-output/<canonical-output>.txt | |
| # gh-pages-branch: gh-pages | |
| # auto-push: true | |
| # | |
| # Blocked on: (a) deciding on a canonical bench output format, (b) | |
| # quiet runner so day-over-day deltas mean something. |