-
Notifications
You must be signed in to change notification settings - Fork 11
81 lines (80 loc) · 3.04 KB
/
jsobmarks.yml
File metadata and controls
81 lines (80 loc) · 3.04 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: JSOBenchmarks
on:
pull_request:
types: [labeled, opened, synchronize, reopened]
workflow_call:
jobs:
bmark:
name: Julia ${{ matrix.version }} - macOS - ${{ matrix.arch }} - ${{ github.event_name }}
if: github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run benchmarks'))
# FIXME: should run on hosted runner
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
version:
- 1
arch:
- aarch64
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@v1
# FIXME: register JSOBenchmarks
- name: Installing non-registered dependencies
run: |
using Pkg
pkg1 = PackageSpec(url = "https://github.com/JuliaSmoothOptimizers/JSOBenchmarks.jl.git", rev = "main")
pkg_list = [pkg1]
Pkg.add(pkg_list)
shell: julia --project=benchmark --color=yes {0}
- name: Install benchmark dependencies
run: julia --project=benchmark -e 'using Pkg; Pkg.instantiate()'
- name: Sanitize project name
id: sanitize
run: echo "REPONAME=${{ github.event.repository.name }}" | sed -e 's/\.jl$//' >> $GITHUB_OUTPUT
- name: Run benchmarks
run: julia --project=benchmark -e 'using JSOBenchmarks; run_benchmarks("${{ steps.sanitize.outputs.REPONAME }}", "benchmark", reference_branch = "main")'
env:
GITHUB_AUTH: ${{ secrets.GIST_TOKEN }}
# - name: Post benchmark results in PR
# uses: thollander/actions-comment-pull-request@v2
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# message: "Full benchmark results stored as artifacts. Summary: ${{ secrets.BMARK_GIST_URL }}"
- name: Build comment
id: build-comment
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
result-encoding: string
script: |
const fs = require('fs');
return fs.readFileSync("${{ github.workspace }}/bmark_${{ github.sha }}.md", "utf8").toString();
- name: Comment in PR
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: ${{ steps.build-comment.outputs.result }}
# - name: Upload benchmark plots
# uses: edunad/actions-image@v2.0.0
# with:
# path: "./*.png"
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# title: "Benchmarks at a Glance"
# annotationLevel: "notice"
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: jso-benchmarks
path: |
profiles_this_commit_vs_reference_*.svg
*_vs_reference_*.jld2
bmark_*.md
reference.md
judgement_*.md