-
Notifications
You must be signed in to change notification settings - Fork 33
291 lines (285 loc) · 9.75 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
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
name: tests
on:
# Run tests on every push to the main branch,
# on every pull request, and once a week (every monday at 05:00)
push:
pull_request:
schedule:
- cron: '0 5 * * 1'
jobs:
canceller:
runs-on: ubuntu-20.04
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
tests-Unix-CLI:
strategy:
fail-fast: false
matrix:
include:
# Ubuntu with the oldest supported GCC
# (used to be 4.8, but with 20.04 it is 7, sadly).
- {os: ubuntu-20.04, gcc: 7, python: 3.8}
- {os: ubuntu-20.04, gcc: 11, python: 3.9}
# macOS, oldest supported version
# (macos-10.15 and macos-11 were removed by GitHub)
- {os: macos-12, python: 3.8}
# macOS, newest supported version (haven't tried macos-14 yet)
- {os: macos-13, python: 3.9}
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true
python-version: ${{ matrix.python }}
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--python-${{ matrix.python }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('treerec/tests/environment.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if
# treerec/tests/environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run:
mamba env update -n anaconda-client-env -f treerec/tests/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Workaround for gcc-11
if: startsWith(matrix.os, 'ubuntu') && matrix.gcc == 11
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update -y
- name: Set up default GCC (in Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} && \
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc }}
- name: Build and test (Debug)
run: |
mkdir Debug && \
cd Debug && \
cmake -D CMAKE_BUILD_TYPE=Debug .. && \
make -j 2 && make test
- name: Build and test (Release)
run: |
mkdir Release && \
cd Release && \
cmake -D CMAKE_BUILD_TYPE=Release .. && \
make -j 2 && make test
- name: Treesequence tests
shell: bash -el {0}
run: |
conda activate anaconda-client-env && \
export PATH=$PATH:$PWD/Release && \
echo $PATH && \
cd treerec/tests && python -m pytest -xv
tests-Windows-CLI:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- {sys: mingw64, env: x86_64, python: 3.8}
- {sys: ucrt64, env: ucrt-x86_64, python: 3.8}
defaults:
run:
shell: msys2 {0}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup MSYS2 ${{matrix.sys}}
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
base-devel
msys2-devel
mingw-w64-${{matrix.env}}-toolchain
mingw-w64-${{matrix.env}}-cmake
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true
auto-update-conda: true
python-version: ${{ matrix.python }}
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--python-${{ matrix.python }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('treerec/tests/environment.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if
# treerec/tests/environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
shell: bash -el {0}
run:
mamba env update -n anaconda-client-env -f treerec/tests/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Build and test (Debug)
run: |
cd windows_compat/gnulib && \
touch --date="`date`" aclocal.m4 Makefile.am configure configure.ac config.h.in Makefile.in && \
cd ../.. && \
mkdir Debug && \
cd Debug && \
cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug .. && \
make -j 2 && make test
- name: Build and test (Release)
run: |
cd windows_compat/gnulib && \
touch --date="`date`" aclocal.m4 Makefile.am configure configure.ac config.h.in Makefile.in && \
cd ../.. && \
mkdir Release && \
cd Release && \
cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release .. && \
make -j 2 && make test
- name: Treesequence tests
shell: bash -el {0}
run: |
conda activate anaconda-client-env && \
export PATH=$PATH:$PWD/Release && \
echo $PATH && \
cd treerec/tests && python -m pytest -xv
tests-Unix-GUI:
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 20.04 with the oldest supported Qt5 and GCC.
- {os: ubuntu-20.04, qt: 5.9.5, gcc: 7}
# Ubuntu 20.04 with the most recent Qt5 and GCC.
- {os: ubuntu-20.04, qt: 5.15.2, gcc: 11}
# Ubuntu 22.04 with the most recent Qt5 and GCC.
- {os: ubuntu-22.04, qt: 5.15.2, gcc: 12}
# Ubuntu 22.04 with the most recent Qt6 and GCC; this is the min for Qt6
- {os: ubuntu-22.04, qt: 6.7.2, gcc: 12}
# old macOS with oldest supported Qt5
- {os: macos-12, qt: 5.9.5}
# new macOS with most recent Qt5
- {os: macos-13, qt: 5.15.2}
# new macOS with most recent Qt6
- {os: macos-13, qt: 6.7.2}
runs-on: ${{ matrix.os }}
env:
CXXFLAGS: -D NO_QT_VERSION_ERROR
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Workaround for gcc-11
if: startsWith(matrix.os, 'ubuntu') && matrix.gcc == 11
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update -y
- name: Set up default GCC (in Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} && \
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc }}
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
- name: Release build with SLiMGUI
run: |
mkdir Release && \
cd Release && \
cmake -D BUILD_SLIMGUI=ON -D CMAKE_BUILD_TYPE=Release .. && \
make -j 2 && make test
tests-Windows-GUI:
strategy:
fail-fast: false
matrix:
include:
- {sys: mingw64, env: x86_64}
- {sys: ucrt64, env: ucrt-x86_64}
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup MSYS2 ${{matrix.sys}}
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
base-devel
msys2-devel
mingw-w64-${{matrix.env}}-toolchain
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-qt5-base
- name: Release build
run: |
cd . && \
cd windows_compat/gnulib && \
touch --date="`date`" aclocal.m4 Makefile.am configure configure.ac config.h.in Makefile.in && \
cd ../.. && \
mkdir Release && \
cd Release && \
cmake -G"MSYS Makefiles" -DBUILD_SLIMGUI=ON -DCMAKE_BUILD_TYPE=Release .. && \
make -j 2 && make test
tests-windows-latest-pacman:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- {sys: mingw64, env: x86_64}
- {sys: ucrt64, env: ucrt-x86_64}
defaults:
run:
shell: msys2 {0}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup MSYS2 ${{matrix.sys}}
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
mingw-w64-${{matrix.env}}-slim-simulator
- name: Test
run: |
eidos -testEidos
slim -testEidos
slim -testSLiM