Skip to content

Commit f66f8d5

Browse files
committed
add benchmarking in CI
1 parent 31ce0b9 commit f66f8d5

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Benchmark
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
permissions:
7+
pull-requests: write # action needs to post a comment
8+
9+
jobs:
10+
benchmark:
11+
name: Julia ${{ matrix.version }} - ${{ matrix.platform.os }} - ${{ matrix.platform.arch }} - ${{ github.event_name }}
12+
runs-on: ${{ matrix.platform.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
platform:
17+
- os: ubuntu-latest
18+
arch: x64
19+
- os: ubuntu-24.04-arm
20+
arch: aarch64
21+
version:
22+
- '1'
23+
- 'lts'
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: julia-actions/setup-julia@v2
27+
with:
28+
version: ${{ matrix.version }}
29+
arch: ${{ matrix.platform.arch }}
30+
- uses: julia-actions/cache@v2
31+
- uses: julia-actions/julia-buildpkg@v1
32+
- name: Run benchmark
33+
run: |
34+
julia --project=benchmark -e 'import Pkg; Pkg.develop(path="."); Pkg.instantiate()'
35+
julia --project=benchmark benchmark/benchmarks.jl benchmark/output.json
36+
- name: Store benchmark result
37+
uses: benchmark-action/github-action-benchmark@v1
38+
with:
39+
tool: 'julia'
40+
output-file-path: benchmark/output.json
41+
benchmark-data-dir-path: benchmark-action/dev/bench
42+
gh-pages-branch: bench-pages
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
summary-always: true
45+
# Show alert with commit comment on detecting possible performance regression
46+
alert-threshold: '200%'
47+
comment-on-alert: true
48+
fail-on-alert: true

0 commit comments

Comments
 (0)