-
Notifications
You must be signed in to change notification settings - Fork 737
198 lines (193 loc) · 7.29 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
197
# for github runner images, see: https://github.com/actions/runner-images?tab=readme-ov-file#available-images
name: interpret-CI
on:
push:
pull_request:
workflow_dispatch:
inputs:
commit_id:
description: 'Commit ID (optional)'
required: false
schedule:
- cron: "0 12 * * *"
jobs:
bld:
strategy:
matrix:
include:
- name: linux_release_64
image: ubuntu-20.04
options: "-release_64"
asm: "-asm"
- name: linux_debug_64
image: ubuntu-20.04
options: "-debug_64"
asm: ""
- name: mac_release_64
image: macos-13 # macos-13 is an intel based mac
options: "-release_64"
asm: "-asm"
- name: mac_debug_64
image: macos-13 # macos-13 is an intel based mac
options: "-debug_64"
asm: ""
- name: mac_release_arm
image: macos-14 # macos-14 is an ARM based mac
options: "-release_arm"
asm: "-asm"
- name: mac_debug_arm
image: macos-14 # macos-14 is an ARM based mac
options: "-debug_arm"
asm: ""
- name: win_release_64
image: windows-2022
options: "-release_64"
asm: ""
- name: win_debug_64
image: windows-2022
options: "-debug_64"
asm: ""
runs-on: ${{ matrix.image }}
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.commit_id || github.sha }}
- name: Build on Windows
if: startsWith(matrix.image, 'windows')
run: |
$env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin'
$env:CudaToolkitDir = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2'
python -c "from urllib.request import urlretrieve; urlretrieve('https://developer.download.nvidia.com/compute/cuda/11.2.2/network_installers/cuda_11.2.2_win10_network.exe', 'cuda_11.2.2_win10_network.exe')"
./cuda_11.2.2_win10_network.exe -s nvcc_11.2 visual_studio_integration_11.2 cudart_11.2
if ($LASTEXITCODE -ne 0) {
Write-Error "cuda_11.2.2_win10_network.exe FAILED"
exit 201
}
./build.bat ${{ matrix.options }} ${{ matrix.asm }}
- name: Build on Linux
if: startsWith(matrix.image, 'ubuntu')
run: |
sudo apt --yes update
sudo apt --yes install nvidia-cuda-toolkit
/bin/sh ./build.sh ${{ matrix.options }} ${{ matrix.asm }}
- name: Build on macOS
if: startsWith(matrix.image, 'macos')
run: |
/bin/sh ./build.sh ${{ matrix.options }} ${{ matrix.asm }}
- name: Publish shared library
uses: actions/upload-artifact@v4
with:
name: libebm_${{ matrix.name }}
path: bld/lib
- name: Publish assembly
if: ${{ matrix.asm != '' }}
uses: actions/upload-artifact@v4
with:
name: asm_${{ matrix.name }}
path: bld/asm/
testC:
needs: [bld]
strategy:
matrix:
include:
- name: linux_release_64
image: ubuntu-latest
options: "-release_64"
existing: "-existing_release_64"
scheduled: "-valgrind"
- name: linux_debug_64
image: ubuntu-latest
options: "-debug_64"
existing: "-existing_debug_64"
scheduled: "-valgrind"
- name: linux_release_32
image: ubuntu-latest
options: "-release_32"
existing: ""
scheduled: "-valgrind"
- name: linux_debug_32
image: ubuntu-latest
options: "-debug_32"
existing: ""
scheduled: "-valgrind"
- name: mac_release_64
image: macos-13 # macos-13 is an intel based mac
options: "-release_64"
existing: "-existing_release_64"
scheduled: ""
- name: mac_debug_64
image: macos-13 # macos-13 is an intel based mac
# don't use the existing debug library since we want to rebuild with asan
options: "-debug_64 -asan"
existing: ""
scheduled: ""
- name: mac_release_arm
image: macos-latest
options: "-release_arm"
existing: "-existing_release_arm"
scheduled: ""
- name: mac_debug_arm
image: macos-latest
# don't use the existing debug library since we want to rebuild with asan
options: "-debug_arm -asan"
existing: ""
scheduled: ""
- name: win_release_64
image: windows-latest
options: "-release_64"
existing: "-existing_release_64"
scheduled: "-analysis"
- name: win_debug_64
image: windows-latest
options: "-debug_64"
existing: "-existing_debug_64"
scheduled: ""
- name: win_release_32
image: windows-latest
options: "-release_32"
existing: ""
scheduled: "-analysis"
- name: win_debug_32
image: windows-latest
options: "-debug_32"
existing: ""
scheduled: ""
runs-on: ${{ matrix.image }}
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.commit_id || github.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Download libebm artifact
if: ${{ matrix.existing != '' }}
uses: actions/download-artifact@v4
with:
name: libebm_${{ matrix.name }}
path: bld/lib
- name: mac test_native
if: ${{ startsWith(matrix.image, 'macos') }}
run: |
/bin/sh ./shared/libebm/tests/libebm_test.sh ${{ matrix.options }} ${{ matrix.existing }}
- name: linux test_native (CI)
if: ${{ startsWith(matrix.image, 'ubuntu') && github.event_name != 'schedule' }}
run: |
/bin/sh ./shared/libebm/tests/libebm_test.sh ${{ matrix.options }} ${{ matrix.existing }}
- name: linux test_native (Schedule)
if: ${{ startsWith(matrix.image, 'ubuntu') && github.event_name == 'schedule' }}
run: |
/bin/sh ./shared/libebm/tests/libebm_test.sh ${{ matrix.options }} ${{ matrix.existing }} ${{ matrix.scheduled }}
- name: win test_native (CI)
if: ${{ startsWith(matrix.image, 'windows') && github.event_name != 'schedule' }}
run: |
$env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin'
./shared/libebm/tests/libebm_test.bat ${{ matrix.options }} ${{ matrix.existing }}
- name: win test_native (Schedule)
if: ${{ startsWith(matrix.image, 'windows') && github.event_name == 'schedule' }}
run: |
$env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin'
./shared/libebm/tests/libebm_test.bat ${{ matrix.options }} ${{ matrix.existing }} ${{ matrix.scheduled }}