v3: enum-tagged dispatch for singleton search strategies (DRAFT — ignore until reviewed by @ChrisRackauckas) #13
Workflow file for this run
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: Benchmarks | |
| on: | |
| pull_request: | |
| paths: | |
| - "src/**" | |
| - "bench/**" | |
| - "Project.toml" | |
| - ".github/workflows/Benchmark.yml" | |
| workflow_dispatch: | |
| # Only one benchmark run per PR at a time; cancel stale ones. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| benchmark: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # we need both PR head and base branch | |
| - uses: julia-actions/setup-julia@v3 | |
| with: | |
| version: "1.11" | |
| - uses: julia-actions/cache@v2 | |
| - name: Install AirspeedVelocity | |
| run: | | |
| julia -e 'using Pkg; Pkg.add(PackageSpec(name="AirspeedVelocity", version="0.6"))' | |
| # Resolve commit shas explicitly so AirspeedVelocity sees stable refs. | |
| - name: Resolve refs | |
| id: resolve | |
| run: | | |
| PR_SHA=$(git rev-parse HEAD) | |
| BASE_SHA=$(git rev-parse origin/${{ github.base_ref }}) | |
| echo "pr_sha=$PR_SHA" >> "$GITHUB_OUTPUT" | |
| echo "base_sha=$BASE_SHA" >> "$GITHUB_OUTPUT" | |
| - name: Run benchmark comparison | |
| run: | | |
| export JULIA_NUM_THREADS=1 | |
| ~/.julia/bin/benchpkg FindFirstFunctions \ | |
| --rev=${{ steps.resolve.outputs.base_sha }},${{ steps.resolve.outputs.pr_sha }} \ | |
| --bench-on=${{ steps.resolve.outputs.pr_sha }} \ | |
| --output-dir=results/ \ | |
| --tune | |
| - name: Render comparison table | |
| run: | | |
| ~/.julia/bin/benchpkgtable FindFirstFunctions \ | |
| --rev=${{ steps.resolve.outputs.base_sha }},${{ steps.resolve.outputs.pr_sha }} \ | |
| --input-dir=results/ \ | |
| > benchmark_table.md | |
| cat benchmark_table.md | |
| - name: Post benchmark comment | |
| if: github.event_name == 'pull_request' | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-path: benchmark_table.md | |
| edit-mode: replace | |
| - name: Upload raw results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results | |
| path: results/ |