-
Notifications
You must be signed in to change notification settings - Fork 12
53 lines (48 loc) · 1.83 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Benchmark a pull request
on:
pull_request:
concurrency:
# Skip intermediate builds: always.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true # allways cancle old runs on new push
permissions:
pull-requests: write
actions: write
contents: read
jobs:
run_benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history
- uses: julia-actions/setup-julia@v2
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: Run benchmarks
env:
JULIA_NUM_THREADS: auto
working-directory: benchmark
run: |
julia --color=yes ./run_benchmarks.jl -t ${{github.event.pull_request.head.ref}} -b ${{github.event.pull_request.base.ref}} --no-data-export --prefix ""
echo '### Benchmark Results' > body.md
echo '' >> body.md
echo '```' >> body.md
cat comparison.txt >> body.md
echo '```' >> body.md
echo '' >> body.md
- name: Upload plot
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: comparison.pdf
path: benchmark/comparison.pdf
- name: Link to graphic
run: |
echo '${{ steps.artifact-upload-step.outputs.artifact-url }}' >> benchmark/body.md
- uses: int128/hide-comment-action@v1 # hide all previous comments
- name: Comment on PR
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body-path: benchmark/body.md