-
Notifications
You must be signed in to change notification settings - Fork 8
196 lines (196 loc) · 6.64 KB
/
CI.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
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
name: CI
on:
push:
branches:
- main
tags: ['*']
pull_request:
schedule:
- cron: '28 0,6,12,18 * * *'
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: ${{ matrix.test_group }}-${{ matrix.version }}-${{ matrix.arch }}
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
strategy:
fail-fast: false
matrix:
test_group: [
'quality',
'basic',
'rrules/avoiding_non_differentiable_code',
'rrules/blas',
'rrules/builtins',
'rrules/fastmath',
'rrules/foreigncall',
'rrules/functionwrappers',
'rrules/iddict',
'rrules/lapack',
'rrules/linear_algebra',
'rrules/low_level_maths',
'rrules/memory',
'rrules/misc',
'rrules/new',
'rrules/tasks',
'rrules/twice_precision',
]
version:
- 'lts'
- '1'
arch:
- x64
include:
- test_group: 'basic'
version: '1.10'
arch: x86
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
include-all-prereleases: false
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
TEST_GROUP: ${{ matrix.test_group }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
extra:
name: ${{matrix.test_group.test_type}}-${{ matrix.test_group.label }}-${{ matrix.version }}-${{ matrix.arch }}
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
strategy:
fail-fast: false
matrix:
test_group: [
{test_type: 'ext', label: 'differentiation_interface'},
{test_type: 'ext', label: 'luxlib'},
{test_type: 'ext', label: 'nnlib'},
{test_type: 'ext', label: 'special_functions'},
{test_type: 'integration_testing', label: 'array'},
{test_type: 'integration_testing', label: 'bijectors'},
{test_type: 'integration_testing', label: 'diff_tests'},
{test_type: 'integration_testing', label: 'distributions'},
{test_type: 'integration_testing', label: 'gp'},
{test_type: 'integration_testing', label: 'logexpfunctions'},
{test_type: 'integration_testing', label: 'lux'},
{test_type: 'integration_testing', label: 'battery_tests'},
{test_type: 'integration_testing', label: 'misc_abstract_array'},
{test_type: 'integration_testing', label: 'temporalgps'},
{test_type: 'integration_testing', label: 'turing'},
]
version:
- '1'
- 'lts'
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
include-all-prereleases: false
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- run: |
if [ ${{ matrix.test_group.test_type }} == 'ext' ]; then
julia --code-coverage=user --eval 'include("test/run_extra.jl")'
else
julia --eval 'include("test/run_extra.jl")'
fi
env:
LABEL: ${{ matrix.test_group.label }}
TEST_TYPE: ${{ matrix.test_group.test_type }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
perf:
name: "Performance (${{ matrix.perf_group }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
perf_group:
- 'hand_written'
- 'derived'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: x64
include-all-prereleases: false
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- run: julia --project=bench --eval 'include("bench/run_benchmarks.jl"); main()'
env:
PERF_GROUP: ${{ matrix.perf_group }}
shell: bash
compperf:
name: "Performance (inter-AD)"
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: x64
include-all-prereleases: false
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- run: mkdir bench_results
- run: julia --project=bench --eval 'include("bench/run_benchmarks.jl"); main()'
env:
PERF_GROUP: 'comparison'
GKSwstype: '100'
shell: bash
- uses: actions/upload-artifact@v4
with:
name: benchmarking-results
path: bench_results/
# Useful code for testing action.
# - run: |
# text="this is line one
# this is line two
# this is line three"
# echo "$text" > benchmark_results.txt
- name: Read file content
id: read-file
run: |
{
echo "table<<EOF"
cat bench/benchmark_results.txt
echo "EOF"
} >> $GITHUB_OUTPUT
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
- id: post-report-as-pr-comment
name: Post Report as Pull Request Comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: "Performance Ratio:\nRatio of time to compute gradient and time to compute function.\nWarning: results are very approximate! See [here](https://github.com/compintell/Mooncake.jl/tree/main/bench#inter-framework-benchmarking) for more context.\n```\n${{ steps.read-file.outputs.table }}\n```"
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace