name: Bench
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BENCH_TOOLCHAIN: 1.98.0
jobs:
skip-update:
name: Skip if baselines were updated for this commit
runs-on: ubuntu-latest
outputs:
baselines-updated: ${{ steps.check.outputs.updated }}
permissions:
pull-requests: read steps:
- name: Check for merged bench-update PR
id: check
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# A squash-merged PR is returned for its single commit on main.
labels="$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/pulls" \
--jq '[.[].labels[].name] | unique | join(",")' || true)"
if grep -q 'bench-update' <<<"$labels"; then
echo "updated=true" >> "$GITHUB_OUTPUT"
else
echo "updated=false" >> "$GITHUB_OUTPUT"
fi
continue-on-error: true
gungraun:
name: gungraun (${{ matrix.os }})
needs: skip-update
if: needs.skip-update.outputs.baselines-updated != 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: actions/checkout@v7
with:
repository: bitshifter/glam-bench-baselines
path: benches/gungraun-baselines
- uses: Swatinem/rust-cache@v2
- run: rustup update --no-self-update ${{ env.BENCH_TOOLCHAIN }}
- run: rustup default ${{ env.BENCH_TOOLCHAIN }}
- name: Install valgrind
run: sudo apt-get update && sudo apt-get install -y valgrind
- run: cargo run --release -p ci -- bench