-
Notifications
You must be signed in to change notification settings - Fork 329
210 lines (177 loc) · 6.6 KB
/
tests.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
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
linux:
name: Linux • Py${{ matrix.config.python }}${{ matrix.config.wheel && ' wheel' || '' }}${{ matrix.config.llvm && ' llvm' || '' }}${{ matrix.config.opaque_pointers && ' opaque' || '' }}
runs-on: ubuntu-20.04
strategy:
matrix:
config:
- {python: '3.10', flake8: true}
- {python: '3.11', flake8: true, clang_format: true}
- {python: '3.12', flake8: true, clang_format: true}
- {python: '3.13', flake8: true, clang_format: true}
- {python: '3.10', wheel: true}
- {python: '3.11', wheel: true}
- {python: '3.12', wheel: true}
- {python: '3.13', wheel: true}
- {python: '3.12', llvm: '16'}
- {python: '3.12', opaque_pointers: 'yes'}
env:
CONDA_ENV: cienv
PYTHON: ${{ matrix.config.python }}
LLVM: ${{ matrix.config.llvm }}
OPAQUE_POINTERS: ${{ matrix.config.opaque_pointers }}
WHEEL: ${{ matrix.config.wheel }}
RUN_FLAKE8: ${{ matrix.config.flake8 }}
RUN_CLANG_FORMAT: ${{ matrix.config.clang_format }}
steps:
- uses: actions/checkout@v4
- name: Cache Miniconda
uses: actions/cache@v4
id: cache-miniconda
with:
path: ~/miniconda3
key: ${{ runner.os }}-miniconda-${{ hashFiles('buildscripts/incremental/install_miniconda.sh') }}
- name: Install Miniconda
if: steps.cache-miniconda.outputs.cache-hit != 'true'
run: |
bash buildscripts/incremental/install_miniconda.sh
- name: Add Conda to PATH
run: echo "$HOME/miniconda3/bin" >> $GITHUB_PATH
- name: Cache Conda Environment
uses: actions/cache@v4
id: cache-conda-env
with:
path: |
~/miniconda3/pkgs
~/miniconda3/envs/${{ env.CONDA_ENV }}
key: ${{ runner.os }}-conda-${{ matrix.config.python }}-${{ hashFiles('buildscripts/incremental/setup_conda_environment.sh') }}
- name: Setup Conda Environment
if: steps.cache-conda-env.outputs.cache-hit != 'true'
run: bash buildscripts/incremental/setup_conda_environment.sh
- name: Build
run: bash buildscripts/incremental/build.sh
- name: Run Flake8
if: matrix.config.flake8
run: |
export PATH=$HOME/miniconda3/bin:$PATH
conda install -y flake8
flake8 llvmlite
- name: Run Tests
run: bash buildscripts/incremental/test.sh
- name: Check C++ formatting
if: matrix.config.clang_format
run: |
export PATH=$HOME/miniconda3/bin:$PATH
conda install -c conda-forge -y clang-format-13
clang-format-13 -n -Werror ffi/*.cpp ffi/*.h
macos:
name: macOS • Py${{ matrix.config.python }}${{ matrix.config.llvm && ' llvm' || '' }}${{ matrix.config.opaque_pointers && ' opaque' || '' }}
runs-on: macos-13
strategy:
matrix:
config:
- {python: '3.10', flake8: true}
- {python: '3.11', flake8: true, clang_format: true}
- {python: '3.12', flake8: true, clang_format: true}
- {python: '3.13', flake8: true, clang_format: true}
- {python: '3.12', llvm: '16'}
- {python: '3.12', opaque_pointers: 'yes'}
env:
CONDA_ENV: cienv
PYTHON: ${{ matrix.config.python }}
LLVM: ${{ matrix.config.llvm }}
OPAQUE_POINTERS: ${{ matrix.config.opaque_pointers }}
RUN_FLAKE8: ${{ matrix.config.flake8 }}
RUN_CLANG_FORMAT: ${{ matrix.config.clang_format }}
MACOSX_DEPLOYMENT_TARGET: '11.0'
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.2'
- name: Cache Miniconda
uses: actions/cache@v4
id: cache-miniconda
with:
path: ~/miniconda3
key: ${{ runner.os }}-miniconda-${{ hashFiles('buildscripts/incremental/install_miniconda.sh') }}
- name: Install Miniconda
if: steps.cache-miniconda.outputs.cache-hit != 'true'
run: |
bash buildscripts/incremental/install_miniconda.sh
- name: Add Conda to PATH
run: echo "$HOME/miniconda3/bin" >> $GITHUB_PATH
- name: Cache Conda Environment
uses: actions/cache@v4
id: cache-conda-env
with:
path: |
~/miniconda3/pkgs
~/miniconda3/envs/${{ env.CONDA_ENV }}
key: ${{ runner.os }}-conda-${{ matrix.config.python }}-${{ hashFiles('buildscripts/incremental/setup_conda_environment.sh') }}
- name: Setup Conda Environment
if: steps.cache-conda-env.outputs.cache-hit != 'true'
run: bash buildscripts/incremental/setup_conda_environment.sh
- name: Build
run: bash buildscripts/incremental/build.sh
- name: Run Flake8
if: matrix.config.flake8
run: |
export PATH=$HOME/miniconda3/bin:$PATH
conda install -y flake8
flake8 llvmlite
- name: Run Tests
run: bash buildscripts/incremental/test.sh
- name: Check C++ formatting
if: matrix.config.clang_format
run: |
export PATH=$HOME/miniconda3/bin:$PATH
conda install -c conda-forge -y clang-format-13
clang-format-13 -n -Werror ffi/*.cpp ffi/*.h
windows:
name: Windows • Py${{ matrix.config.python }}${{ matrix.config.llvm && ' llvm' || '' }}${{ matrix.config.opaque_pointers && ' opaque' || '' }}
runs-on: windows-2019
strategy:
matrix:
config:
- {python: '3.10'}
- {python: '3.11'}
- {python: '3.12'}
- {python: '3.13'}
- {python: '3.12', llvm: '16'}
- {python: '3.12', opaque_pointers: 'yes'}
env:
CONDA_ENV: cienv
PYTHON: ${{ matrix.config.python }}
LLVM: ${{ matrix.config.llvm }}
OPAQUE_POINTERS: ${{ matrix.config.opaque_pointers }}
steps:
- uses: actions/checkout@v4
- name: Install Miniconda
shell: pwsh
run: |
$wc = New-Object net.webclient
$wc.Downloadfile("https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe", "Miniconda3-latest-Windows-x86_64.exe")
Start-Process "Miniconda3-latest-Windows-x86_64.exe" "/S /D=C:\Miniconda3" -Wait
- name: Setup Conda Environment
shell: cmd
run: |
call C:\Miniconda3\Scripts\activate.bat
call buildscripts\incremental\setup_conda_environment.cmd
- name: Build
shell: cmd
run: |
call C:\Miniconda3\Scripts\activate.bat
call buildscripts\incremental\build.cmd
- name: Run Tests
shell: cmd
run: |
call C:\Miniconda3\Scripts\activate.bat
call buildscripts\incremental\test.cmd