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/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Benchmarks

# spell-checker:ignore codspeed dtolnay Swatinem sccache

on:
pull_request:
push:
branches:
- '*'

permissions:
contents: read # to fetch code (actions/checkout)

# End the current execution if there is a new changeset in the PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
benchmarks:
name: Run benchmarks (CodSpeed)
runs-on: ubuntu-latest
strategy:
matrix:
benchmark-target:
- { package: sed }
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- name: Install system dependencies
shell: bash
run: |
sudo apt-get -y update

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9

- name: Install cargo-codspeed
shell: bash
run: cargo install cargo-codspeed --locked

- name: Build benchmarks for ${{ matrix.benchmark-target.package }}
shell: bash
run: |
echo "Building benchmarks for ${{ matrix.benchmark-target.package }}"
cargo codspeed build -p ${{ matrix.benchmark-target.package }}

- name: Run benchmarks for ${{ matrix.benchmark-target.package }}
uses: CodSpeedHQ/action@v4
env:
CODSPEED_LOG: debug
with:
mode: simulation
run: |
echo "Running benchmarks for ${{ matrix.benchmark-target.package }}"
cargo codspeed run -p ${{ matrix.benchmark-target.package }} > /dev/null
token: ${{ secrets.CODSPEED_TOKEN }}
Loading
Loading