mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
name: CodSpeed Benchmarks
|
|
|
|
# spell-checker: disable
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
benchmarks:
|
|
name: Run benchmarks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install system dependencies
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get -y update
|
|
sudo apt-get -y install libselinux1-dev
|
|
|
|
- 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: Run benchmarks
|
|
uses: CodSpeedHQ/action@v4
|
|
with:
|
|
mode: instrumentation
|
|
run: |
|
|
# Find all utilities with benchmarks and run them
|
|
find src/uu/*/benches/ -name "*.rs" 2>/dev/null | while read bench_file; do
|
|
crate_dir=$(dirname $(dirname "$bench_file"))
|
|
echo "Building benchmarks in $crate_dir"
|
|
(cd "$crate_dir" && cargo codspeed build)
|
|
echo "Running benchmarks in $crate_dir"
|
|
(cd "$crate_dir" && cargo codspeed run)
|
|
done
|
|
token: ${{ secrets.CODSPEED_TOKEN }}
|