Add benchmark tracking #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: Benchmark Tracking | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
deployments: write | |
concurrency: | |
# Skip intermediate builds: always. | |
# Cancel intermediate builds: only if it is a pull request build. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: '1' | |
arch: x64 | |
- uses: actions/cache@v4 | |
env: | |
cache-name: cache-artifacts | |
with: | |
path: ~/.julia/artifacts | |
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | |
restore-keys: | | |
${{ runner.os }}-test-${{ env.cache-name }}- | |
${{ runner.os }}-test- | |
${{ runner.os }}- | |
- name: Run benchmark | |
run: | | |
cd benchmarks | |
julia --project --threads=2 --color=yes -e ' | |
using Pkg; | |
Pkg.develop(PackageSpec(path=joinpath(pwd(), ".."))); | |
Pkg.instantiate(); | |
include("runbenchmarks.jl")' | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Julia benchmark result | |
tool: "julia" | |
output-file-path: benchmarks/benchmarks_output.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
auto-push: ${{ github.event_name != 'pull_request' }} | |
# Show alert with commit comment on detecting possible performance regression | |
alert-threshold: "200%" | |
comment-on-alert: true | |
fail-on-alert: true | |
alert-comment-cc-users: "@ktrz,@findmyway" |