test: Add benchmark test #1
Workflow file for this run
This file contains 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: Performance Comparison | |
on: | |
pull_request_target: | |
branches: | |
- master | |
permissions: | |
pull-requests: write | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: "1" | |
- uses: julia-actions/cache@v2 | |
- name: Install AirspeedVelocity | |
run: | | |
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.add(url="https://github.com/MilesCranmer/AirspeedVelocity.jl.git")' | |
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.build("AirspeedVelocity")' | |
- name: Add Julia bin to PATH | |
run: echo "$HOME/.julia/bin" >> $GITHUB_PATH | |
- name: Run benchmarks | |
run: | | |
mkdir results | |
benchpkg SymbolicRegression --rev="MilesCranmer/SymbolicRegression.jl#master,${{github.event.pull_request.head.sha}}" --url=${{ github.event.repository.clone_url }} --bench-on="${{github.event.pull_request.head.sha}}" --output-dir=results/ --exeflags="-O3 --threads=auto" | |
- name: Generate comparison table | |
run: | | |
benchpkgtable SymbolicRegression --rev="MilesCranmer/SymbolicRegression.jl#master,${{github.event.pull_request.head.sha}}" --input-dir=results/ --ratio > table.md | |
echo '### Performance Comparison vs MilesCranmer/SymbolicRegression.jl' > body.md | |
echo '' >> body.md | |
cat table.md >> body.md | |
- name: Find Comment | |
uses: peter-evans/find-comment@v3 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: "github-actions[bot]" | |
body-includes: Performance Comparison | |
- name: Comment PR | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body-path: body.md | |
edit-mode: replace |