Repository navigation
230 lines (219 loc) · 13.3 KB
/
Copy pathci.yml
File metadata and controls
230 lines (219 loc) · 13.3 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
JULIA_VERSION: '1.12.6'
jobs:
changes:
runs-on: ubuntu-latest
outputs:
execution: ${{ steps.diff.outputs.execution }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with: {fetch-depth: 0}
- name: Select execution checks from the whole PR diff
id: diff
env:
EVENT: ${{ github.event_name }}
BASE: ${{ github.event.pull_request.base.sha }}
HEAD: ${{ github.event.pull_request.head.sha }}
shell: bash
run: |
execution=true
if [[ "$EVENT" == pull_request ]] && git cat-file -e "$BASE^{commit}" && git cat-file -e "$HEAD^{commit}"; then
git diff --no-renames --name-only -z "$BASE...$HEAD" > "$RUNNER_TEMP/localmath-changed-paths"
execution=false
while IFS= read -r -d '' path; do
case "$path" in
AGENTS.md|CONTRIBUTING.md|README.md|LICENSE|CITATION.cff|spec/*.md|design/*.md) ;;
*) execution=true; break ;;
esac
done < "$RUNNER_TEMP/localmath-changed-paths"
fi
printf 'execution=%s\n' "$execution" >> "$GITHUB_OUTPUT"
git rev-parse HEAD
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: julia-actions/setup-julia@fa02766e078afaaf09b14210362cee14137e6a32 # v3
with: {version: '${{ env.JULIA_VERSION }}'}
- uses: julia-actions/cache@a45e8fa8be21c18a06b7177052533149e61e9b38 # v3
id: cache
- name: Package environment and tests
env:
LOCALMATH_CI_TELEMETRY: ${{ runner.temp }}/localmath-telemetry/fixtures
run: |
mkdir -p "$RUNNER_TEMP/localmath-telemetry/fixtures"
measure=(python3 .github/ci/measure.py --output "$RUNNER_TEMP/localmath-telemetry" --job package)
"${measure[@]}" --phase cache-observation --annotation cache_hit=${{ steps.cache.outputs.cache-hit }} -- python3 -c 'pass'
"${measure[@]}" --phase instantiate -- env JULIA_PKG_PRECOMPILE_AUTO=0 julia --project=. --startup-file=no -e 'using Pkg; Pkg.instantiate()'
"${measure[@]}" --phase precompile -- julia --project=. --startup-file=no -e 'using Pkg; Pkg.precompile()'
"${measure[@]}" --phase import -- julia --project=. --startup-file=no -e 'using LocalMath'
"${measure[@]}" --phase suite --log "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" -- julia --project=. --startup-file=no -e 'using Pkg; Pkg.test(; test_args=["--jobs=2", "--verbose"])'
- name: Structure ParallelTestRunner totals
if: always()
run: |
test ! -f "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" || python3 .github/ci/summarize_parallel_tests.py "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" "$RUNNER_TEMP/localmath-telemetry/parallel-tests.json" --job package
- name: Upload package telemetry
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: telemetry-package-${{ github.run_attempt }}
path: ${{ runner.temp }}/localmath-telemetry
if-no-files-found: error
scientific:
needs: changes
if: always() && (needs.changes.result != 'success' || needs.changes.outputs.execution != 'false')
runs-on: ubuntu-latest
steps:
- name: Require a valid change selection
if: needs.changes.result != 'success' || (needs.changes.outputs.execution != 'true' && needs.changes.outputs.execution != 'false')
run: exit 1
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: julia-actions/setup-julia@fa02766e078afaaf09b14210362cee14137e6a32 # v3
with: {version: '${{ env.JULIA_VERSION }}'}
- uses: julia-actions/cache@a45e8fa8be21c18a06b7177052533149e61e9b38 # v3
id: cache
- name: Scientific environment and witnesses
env:
LOCALMATH_CI_TELEMETRY: ${{ runner.temp }}/localmath-telemetry/fixtures
run: |
mkdir -p "$RUNNER_TEMP/localmath-telemetry/fixtures"
measure=(python3 .github/ci/measure.py --output "$RUNNER_TEMP/localmath-telemetry" --job scientific)
"${measure[@]}" --phase cache-observation --annotation cache_hit=${{ steps.cache.outputs.cache-hit }} -- python3 -c 'pass'
"${measure[@]}" --phase instantiate -- env JULIA_PKG_PRECOMPILE_AUTO=0 julia --project=test/scientific_witnesses --startup-file=no -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
"${measure[@]}" --phase precompile -- julia --project=test/scientific_witnesses --startup-file=no -e 'using Pkg; Pkg.precompile()'
"${measure[@]}" --phase import -- julia --project=test/scientific_witnesses --startup-file=no -e 'using LocalMath'
"${measure[@]}" --phase suite --log "$RUNNER_TEMP/localmath-telemetry/scientific.log" -- julia --project=test/scientific_witnesses --startup-file=no -e 'include("test/scientific_witnesses/runtests.jl")'
- name: Upload scientific telemetry
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: telemetry-scientific-${{ github.run_attempt }}
path: ${{ runner.temp }}/localmath-telemetry
if-no-files-found: error
macos-smoke:
if: github.event_name == 'pull_request'
runs-on: macos-15
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: julia-actions/setup-julia@fa02766e078afaaf09b14210362cee14137e6a32 # v3
with: {version: '${{ env.JULIA_VERSION }}'}
- uses: julia-actions/cache@a45e8fa8be21c18a06b7177052533149e61e9b38 # v3
id: cache
- name: Public API and KernelAbstractions smoke tests
env:
LOCALMATH_CI_TELEMETRY: ${{ runner.temp }}/localmath-telemetry/fixtures
run: |
mkdir -p "$RUNNER_TEMP/localmath-telemetry/fixtures"
measure=(python3 .github/ci/measure.py --output "$RUNNER_TEMP/localmath-telemetry" --job macos-smoke)
"${measure[@]}" --phase cache-observation --annotation cache_hit=${{ steps.cache.outputs.cache-hit }} -- python3 -c 'pass'
"${measure[@]}" --phase instantiate -- env JULIA_PKG_PRECOMPILE_AUTO=0 julia --project=. --startup-file=no -e 'using Pkg; Pkg.instantiate()'
"${measure[@]}" --phase precompile -- julia --project=. --startup-file=no -e 'using Pkg; Pkg.precompile()'
"${measure[@]}" --phase import -- julia --project=. --startup-file=no -e 'using LocalMath'
"${measure[@]}" --phase suite --log "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" -- julia --project=. --startup-file=no -e 'using Pkg; Pkg.test(; test_args=["--jobs=1", "--verbose", "test_public_api", "test_direct_pointwise_stage"])'
- name: Structure ParallelTestRunner totals
if: always()
run: test ! -f "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" || python3 .github/ci/summarize_parallel_tests.py "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" "$RUNNER_TEMP/localmath-telemetry/parallel-tests.json" --job macos-smoke
- name: Upload macOS smoke telemetry
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: telemetry-macos-smoke-${{ github.run_attempt }}
path: ${{ runner.temp }}/localmath-telemetry
if-no-files-found: error
macos-package:
if: github.event_name != 'pull_request'
runs-on: macos-15
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: julia-actions/setup-julia@fa02766e078afaaf09b14210362cee14137e6a32 # v3
with: {version: '${{ env.JULIA_VERSION }}'}
- uses: julia-actions/cache@a45e8fa8be21c18a06b7177052533149e61e9b38 # v3
id: cache
- name: Complete macOS package tests
env:
LOCALMATH_CI_TELEMETRY: ${{ runner.temp }}/localmath-telemetry/fixtures
run: |
mkdir -p "$RUNNER_TEMP/localmath-telemetry/fixtures"
measure=(python3 .github/ci/measure.py --output "$RUNNER_TEMP/localmath-telemetry" --job macos-package)
"${measure[@]}" --phase cache-observation --annotation cache_hit=${{ steps.cache.outputs.cache-hit }} -- python3 -c 'pass'
"${measure[@]}" --phase instantiate -- env JULIA_PKG_PRECOMPILE_AUTO=0 julia --project=. --startup-file=no -e 'using Pkg; Pkg.instantiate()'
"${measure[@]}" --phase precompile -- julia --project=. --startup-file=no -e 'using Pkg; Pkg.precompile()'
"${measure[@]}" --phase import -- julia --project=. --startup-file=no -e 'using LocalMath'
"${measure[@]}" --phase suite --log "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" -- julia --project=. --startup-file=no -e 'using Pkg; Pkg.test(; test_args=["--jobs=2", "--verbose"])'
- name: Structure ParallelTestRunner totals
if: always()
run: test ! -f "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" || python3 .github/ci/summarize_parallel_tests.py "$RUNNER_TEMP/localmath-telemetry/parallel-tests.log" "$RUNNER_TEMP/localmath-telemetry/parallel-tests.json" --job macos-package
- name: Upload macOS package telemetry
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: telemetry-macos-package-${{ github.run_attempt }}
path: ${{ runner.temp }}/localmath-telemetry
if-no-files-found: error
docs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: julia-actions/setup-julia@fa02766e078afaaf09b14210362cee14137e6a32 # v3
with: {version: '${{ env.JULIA_VERSION }}'}
- uses: julia-actions/cache@a45e8fa8be21c18a06b7177052533149e61e9b38 # v3
id: cache
- name: Documentation
run: |
mkdir -p "$RUNNER_TEMP/localmath-telemetry"
measure=(python3 .github/ci/measure.py --output "$RUNNER_TEMP/localmath-telemetry" --job docs)
"${measure[@]}" --phase cache-observation --annotation cache_hit=${{ steps.cache.outputs.cache-hit }} -- python3 -c 'pass'
"${measure[@]}" --phase instantiate -- env JULIA_PKG_PRECOMPILE_AUTO=0 julia --project=docs --startup-file=no -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
"${measure[@]}" --phase precompile -- julia --project=docs --startup-file=no -e 'using Pkg; Pkg.precompile()'
"${measure[@]}" --phase import -- julia --project=docs --startup-file=no -e 'using Documenter, LocalMath'
"${measure[@]}" --phase suite --log "$RUNNER_TEMP/localmath-telemetry/docs.log" -- julia --project=docs --startup-file=no -e 'include("docs/make.jl")'
- name: Upload documentation telemetry
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: telemetry-docs-${{ github.run_attempt }}
path: ${{ runner.temp }}/localmath-telemetry
if-no-files-found: error
metal:
needs: changes
if: always() && (needs.changes.result != 'success' || needs.changes.outputs.execution != 'false')
runs-on: macos-15
steps:
- name: Require a valid change selection
if: needs.changes.result != 'success' || (needs.changes.outputs.execution != 'true' && needs.changes.outputs.execution != 'false')
run: exit 1
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: julia-actions/setup-julia@fa02766e078afaaf09b14210362cee14137e6a32 # v3
with: {version: '${{ env.JULIA_VERSION }}'}
- uses: julia-actions/cache@a45e8fa8be21c18a06b7177052533149e61e9b38 # v3
id: cache
- name: Metal qualification
env:
LOCALMATH_CI_TELEMETRY: ${{ runner.temp }}/localmath-telemetry/fixtures
run: |
mkdir -p "$RUNNER_TEMP/localmath-telemetry/fixtures"
measure=(python3 .github/ci/measure.py --output "$RUNNER_TEMP/localmath-telemetry" --job metal)
"${measure[@]}" --phase cache-observation --annotation cache_hit=${{ steps.cache.outputs.cache-hit }} -- python3 -c 'pass'
"${measure[@]}" --phase instantiate -- env JULIA_PKG_PRECOMPILE_AUTO=0 julia --project=test/metal --startup-file=no -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
"${measure[@]}" --phase precompile -- julia --project=test/metal --startup-file=no -e 'using Pkg; Pkg.precompile()'
"${measure[@]}" --phase import -- julia --project=test/metal --startup-file=no -e 'using KernelAbstractions, LocalMath, Metal'
"${measure[@]}" --phase suite --log "$RUNNER_TEMP/localmath-telemetry/metal.log" -- julia --project=test/metal --startup-file=no -e 'include("test/metal/runtests.jl")'
- name: Upload Metal telemetry
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: telemetry-metal-${{ github.run_attempt }}
path: ${{ runner.temp }}/localmath-telemetry
if-no-files-found: error