-
Notifications
You must be signed in to change notification settings - Fork 0
302 lines (242 loc) · 8.52 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
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# SPDX-FileCopyrightText: 2022 - 2023 Peter Urban, Ghent University
#
# SPDX-License-Identifier: CC0-1.0
name: CI
on:
push:
branches: [ main ]
paths-ignore:
- '.github/workflows/python-package*'
- '.github/workflows/cibuildwheels*'
- '.github/workflows/conda*'
- '.github/workflows/test_*'
- 'conda.recipe/*'
- '*.md'
- 'doc/*'
#paths:
# - "**meson.build"
# - "**.cpp"
# - "**.c"
# - "**.h"
pull_request:
branches: [ main ]
paths-ignore:
- '.github/workflows/python-package*'
- '.github/workflows/cibuildwheels*'
- '.github/workflows/conda*'
- '.github/workflows/test_*'
- 'conda.recipe/*'
- '*.md'
- 'doc/*'
#paths:
# - "**meson.build"
# - "**.cpp"
# - "**.c"
# - "**.h"
# make sure that multiple jobs don't run for the same action (new commits cancel old jobs when they are still running)
# Souce Ralf Gommers (commit to meson-python)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
#BUILD_TYPE: Release
jobs:
linux:
name: ci on ${{matrix.container}}
strategy:
fail-fast: false
matrix:
include:
- { container: 'ghcr.io/themachinethatgoesping/ubuntu-dep:latest',
ccache: 'true',
pip2: 'pip install -r requirements.txt --break-system-packages' }
- { container: 'ubuntu:22.04',
ccache: 'true',
pre-dep : 'apt update && apt-get install -y sudo git git-lfs',
dep : 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ccache pkg-config cmake python3-pip libboost-all-dev libcurl4-openssl-dev',
pip : 'pip install meson meson-python ninja pytest numpy',
pip2: 'pip install -r requirements.txt'}
- { container: 'archlinux',
pre-dep : 'pacman -Syu --noconfirm; pacman -Syy sudo git git-lfs --noconfirm',
dep : 'sudo pacman -Syy --noconfirm base-devel ccache pkg-config cmake python-pip boost curl',
pip : 'pip install meson meson-python ninja pytest numpy --break-system-packages',
pip2: 'pip install -r requirements.txt --break-system-packages' }
runs-on: ubuntu-latest
container: ${{matrix.container}}
steps:
- name: install perquisites
if: ${{matrix.pre-dep}}
run: ${{matrix.pre-dep}}
- name: checkout main repository
uses: actions/checkout@v3
with:
submodules: recursive
lfs: false
- name: ccache
if: ${{ matrix.ccache }}
uses: hendrikmuhs/[email protected]
with:
key: super-ci-${{ matrix.container }} # name for the cache
- name: install dependencies (c++)
if: ${{matrix.dep}}
run: ${{matrix.dep}}
- name: install dependencies (meson & python)
if: ${{matrix.pip}}
run: ${{matrix.pip}}
- name: configure meson
run: meson setup builddir/; meson configure builddir -Dpython.install_env=auto -Dprefix=/usr/;
- name: compile project
run: meson compile -C builddir/
- name: test (cpp)
run: meson test -C builddir/ --print-errorlogs
- name: install project
run: meson install -C builddir/
- name: install pip requirements
if: ${{matrix.pip2}}
run: ${{matrix.pip2}}
- name: test (pytest)
run: pytest -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{matrix.container}}_testlog
path: builddir/meson-logs/testlog.txt
build-on-windows:
name: ci on windows
strategy:
fail-fast: false
matrix:
boost-version: [1.84.0]
boost-version_: [1_84_0]
boost-modules: [--with-iostreams]
include:
- toolset: vc143
compiler: clang-cl
cpp_std: c++20
# - toolset: msvc
# compiler: sccache cl
# cpp_std: c++20
env:
#CC: msvc-14.32
CC: ${{matrix.compiler}}
CXX: ${{matrix.compiler}}
#this is where we will download ninja later
NINJA: d:/ninja.exe
runs-on: windows-latest
#container: python:latest #pull directly from dockerhub
steps:
- name: setup python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
# make sure meson can find msvc
- uses: TheMrMilchmann/setup-msvc-dev@v2
with:
arch: x64
#toolset: 14.34
- name: checkout main repository
uses: actions/checkout@v3
with:
submodules: recursive
lfs: false
- name: sccache
uses: hendrikmuhs/[email protected]
with:
key: super-ci-win # name for the cache
variant: sccache # supports windows
- name: Cache Boost
id: cache-boost
uses: actions/cache@v3
with:
path: c:\Boost
#key: windows-msvc-14.32-boost-${{matrix.boost-version}}-${{matrix.boost-modules}}
key: windows-${{matrix.toolset}}-boost-${{matrix.boost-version}}-${{matrix.boost-modules}}
- name: Install dependencies on windows
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://boostorg.jfrog.io/artifactory/main/release/${{matrix.boost-version}}/source/boost_${{matrix.boost-version_}}.7z -outfile boost.7z
7z x boost.7z
cd .\boost_${{matrix.boost-version_}}\
.\bootstrap.bat ${{matrix.toolset}}
.\b2.exe install --variant=release --threading=multi --link=static ${{matrix.boost-modules}}
cd ..
#rm -rv boost*
- name: install dependencies (meson & python)
run: pip install meson meson-python pytest numpy
#run: pip install meson meson-python pytest numpy ninja
- name: download ninja long path
run : |
Invoke-WebRequest -Uri https://raw.githubusercontent.com/themachinethatgoesping/tools/main/ninja-windows/ninja.exe -OutFile d:\ninja.exe
- name: check ninja executable path
run: |
$env:NINJA
d:\ninja.exe --version
- name: configure meson
run: |
meson setup builddir/ -D"python.install_env=auto" -Ddefault_library=static -D"python.install_env=auto" -Dcpp_std=${{matrix.cpp_std}}
- name: compile project
run: meson compile -C builddir/
- name: test (cpp)
#run: meson test -C builddir/ --print-errorlogs
# meson test does not work with the custom ninja executable
run: ninja test -C builddir/ --verbose
- name: install project
run: meson install -C builddir/
- name: install pip requirements
run: pip install -r requirements.txt
- name: test (pytest)
run: pytest -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Windows_Meson_testlog
path: builddir/meson-logs/testlog.txt
macos:
name: ci on macOS
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
cxx_compiler: ["$(brew --prefix llvm@16)/bin/clang++"]
# env does not work here because is resolved as string and not command
# env:
# CXX: ${{ matrix.cxx_compiler }}
steps:
- uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: checkout main repository
uses: actions/checkout@v3
with:
submodules: recursive
lfs: false
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: super-ci-mac # name for the cache
# install clang 15
- run: brew install coreutils llvm@16
- run: brew install libomp boost
- run: pip install meson meson-python ninja pytest numpy
- name: configure meson
run: CXX=${{ matrix.cxx_compiler }} meson setup builddir/; meson configure builddir -Dpython.install_env=auto
- name: compile project
run: meson compile -C builddir/
- name: test (cpp)
run: meson test -C builddir/ --print-errorlogs
- name: install project
run: meson install -C builddir/
- name: install pip requirements
run: pip install -r requirements.txt
- name: test (pytest)
run: pytest -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{matrix.container}}_testlog
path: builddir/meson-logs/testlog.txt