Skip to content

Commit eca4a2a

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

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
run: |
33+
julia --project=benchmark -e 'import Pkg; Pkg.develop(".."); Pkg.instantiate()'
34+
julia --project=benchmark benchmark/benchmarks.jl benchmark/output.json
35+
- name: Store benchmark result
36+
uses: benchmark-action/github-action-benchmark@v1
37+
with:
38+
tool: 'julia'
39+
output-file-path: benchmark/output.json
40+
benchmark-data-dir-path: benchmark-action/dev/bench
41+
gh-pages-branch: bench-pages
42+
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
summary-always: true
44+
# Show alert with commit comment on detecting possible performance regression
45+
alert-threshold: '200%'
46+
comment-on-alert: true
47+
fail-on-alert: true

0 commit comments

Comments
 (0)