-
-
Notifications
You must be signed in to change notification settings - Fork 112
140 lines (127 loc) · 4.83 KB
/
Copy pathbenchmarks.yml
File metadata and controls
140 lines (127 loc) · 4.83 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Benchmarks
on:
push:
branches: [master]
paths:
- 'benchmarks/**'
pull_request:
paths:
- 'benchmarks/**'
workflow_dispatch:
inputs:
benchmark_target:
description: 'Specific benchmark target to run (e.g. benchmarks/NonStiffODE or benchmarks/NonStiffODE/linear_wpd.jmd). Leave empty to detect from changes.'
required: false
type: string
# Cancel in-progress PR runs (but not master — benchmarks are long-running)
concurrency:
group: benchmarks-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
detect-changes:
name: Detect Changed Benchmarks
runs-on: ubuntu-latest
# Skip change detection if a manual target is provided
if: ${{ github.event.inputs.benchmark_target == '' || github.event.inputs.benchmark_target == null }}
outputs:
matrix: ${{ steps.detect.outputs.matrix }}
has_changes: ${{ steps.detect.outputs.has_changes }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Detect changed benchmarks
id: detect
run: .github/scripts/detect-changed-benchmarks.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# When manually triggered with a specific target
manual-matrix:
name: Manual Target
runs-on: ubuntu-latest
if: ${{ github.event.inputs.benchmark_target != '' && github.event.inputs.benchmark_target != null }}
outputs:
matrix: ${{ steps.manual.outputs.matrix }}
has_changes: ${{ steps.manual.outputs.has_changes }}
steps:
- uses: actions/checkout@v7
- name: Set manual target
id: manual
run: |
target="${{ github.event.inputs.benchmark_target }}"
source .github/scripts/read-benchmark-config.sh
config=$(get_benchmark_config "${target}")
runner=$(echo "${config}" | cut -d'|' -f1)
timeout=$(echo "${config}" | cut -d'|' -f2)
julia_version=$(echo "${config}" | cut -d'|' -f3)
echo "has_changes=true" >> "$GITHUB_OUTPUT"
echo "matrix=[{\"target\":\"${target}\",\"runner\":${runner},\"timeout\":${timeout},\"julia_version\":\"${julia_version}\"}]" >> "$GITHUB_OUTPUT"
benchmark:
name: "Run: ${{ matrix.target }}"
needs: [detect-changes, manual-matrix]
# Run if either job produced changes (the other will be skipped)
if: |
always() && (
(needs.detect-changes.result == 'success' && needs.detect-changes.outputs.has_changes == 'true') ||
(needs.manual-matrix.result == 'success' && needs.manual-matrix.outputs.has_changes == 'true')
)
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include: ${{ fromJson(needs.detect-changes.outputs.matrix || needs.manual-matrix.outputs.matrix) }}
fail-fast: false
timeout-minutes: ${{ matrix.timeout }}
env:
JULIA_NUM_THREADS: auto
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.julia_version }}
- uses: julia-actions/cache@v3
- name: Build benchmark
run: .github/scripts/build_benchmark.sh "${{ matrix.target }}"
env:
JULIAHUB_TOKEN: ${{ secrets.JULIAHUB_TOKEN }}
- name: Sanitize artifact name
if: always()
id: artifact-name
run: |
name=$(echo "${{ matrix.target }}" | tr '/' '-' | tr '.' '-')
echo "name=benchmark-${name}" >> "$GITHUB_OUTPUT"
- name: Upload benchmark artifacts
if: success()
uses: actions/upload-artifact@v7
with:
name: ${{ steps.artifact-name.outputs.name }}
path: |
markdown/
notebook/
pdf/
script/
retention-days: 30
publish:
name: Publish Results
needs: benchmark
# Publish whenever the benchmark stage actually ran (success OR failure),
# so one folder's failure doesn't block other folders' artifacts from
# reaching SciMLBenchmarksOutput. download-artifact pulls only artifacts
# that were actually uploaded (only successful builds upload), and
# publish_benchmark_output.sh is a no-op when there's nothing new.
if: always() && github.ref == 'refs/heads/master' && (needs.benchmark.result == 'success' || needs.benchmark.result == 'failure')
runs-on: [self-hosted, benchmark]
concurrency:
group: scimlbenchmarks-deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@v7
- name: Download all benchmark artifacts
uses: actions/download-artifact@v8
with:
pattern: benchmark-*
merge-multiple: true
continue-on-error: true
- name: Publish to SciMLBenchmarksOutput
run: .github/scripts/publish_benchmark_output.sh
env:
DEPLOY_KEY: ${{ secrets.SCIML_BENCHMARKS_DEPLOY_KEY }}