Skip to content

Run benchmarks in the correct context and compare main vs PR #3

Run benchmarks in the correct context and compare main vs PR

Run benchmarks in the correct context and compare main vs PR #3

Workflow file for this run

name: Run and Cache Benchmarks
on:
pull_request:
types: [ opened, reopened, edited, synchronize ]
jobs:
benchmark:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run benchmarks on main - solvers
run: cargo bench -- solvers --exact | tail -n +6 > results_main.txt
- name: Checkout PR branch
uses: actions/checkout@v2
- name: Run benchmarks on PR branch
run: cargo bench -- solvers --exact | tail -n +6 > results_pr.txt
- name: Upload Benchmark Results
uses: actions/upload-artifact@v4
with:
name: benchmark_results
path: ./results_*.txt
if-no-files-found: error
- name: Upload GitHub Pull Request Event
uses: actions/upload-artifact@v4
with:
name: event.json
path: ${{ github.event_path }}