-
Notifications
You must be signed in to change notification settings - Fork 36
340 lines (335 loc) · 12.6 KB
/
tests.yml
File metadata and controls
340 lines (335 loc) · 12.6 KB
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
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-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.1
coverage:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up GCC
run: |
sudo apt-get install gcc-12 g++-12 && \
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-12
- name: Build with coverage
run: |
mkdir Coverage && cd Coverage && \
cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON .. && \
make -j 2 && \
env CTEST_OUTPUT_ON_FAILURE=1 make test
- name: Generate coverage report
run: |
sudo apt-get update && \
sudo apt-get install -y lcov && \
lcov --gcov-tool gcov-12 --ignore-errors gcov,mismatch --rc geninfo_unexecuted_blocks=1 --capture --directory Coverage --output-file coverage.info && \
lcov --gcov-tool gcov-12 --ignore-errors gcov,mismatch,unused --remove coverage.info '/usr/*' '*/gsl/*' '*/eidos_zlib/*' --output-file coverage.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
fail_ci_if_error: true
tests-Unix-CLI:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
strategy:
fail-fast: false
matrix:
include:
# Ubuntu with the oldest supported GCC
# BCH 2/12/2025: Ubuntu 22.04 is being discontinued, shifting forward
- { os: ubuntu-22.04, gcc: 9, python: 3.9 }
- { os: ubuntu-24.04, gcc: 12, python: 3.12 }
# macOS, oldest supported version
# (macos-10.15, macos-11, macos-12, and macos-13 were removed by GitHub)
- { os: macos-14, python: 3.9 }
# macOS, newest supported version
- { os: macos-26, python: 3.13 }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: anaconda-client-env
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: conda 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 -DCMAKE_BUILD_TYPE=Debug .. && \
make -j 2 && \
# Show any output from the test program whenever the test fails
env CTEST_OUTPUT_ON_FAILURE=1 make test
- name: Build and test (Release)
run: |
mkdir Release && \
cd Release && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j 2 && \
# Show any output from the test program whenever the test fails
env CTEST_OUTPUT_ON_FAILURE=1 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:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw64, env: x86_64, python: 3.9 }
- { sys: ucrt64, env: ucrt-x86_64, python: 3.9 }
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 Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: anaconda-client-env
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
env:
# Increase this value to reset cache if treerec/tests/environment.yml has not changed
CACHE_NUMBER: 0
with:
# Use faster GNU tar
enableCrossOsArchive: true
path: D:\conda_pkgs_dir
key:
conda-${{ runner.os }}--python-${{ matrix.python }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('treerec/tests/environment.yml') }}-${{ env.CACHE_NUMBER}}
id: cache
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: anaconda-client-env
environment-file: treerec/tests/environment.yml
pkgs-dirs: D:\conda_pkgs_dir
- name: Update environment
shell: bash -el {0}
run: conda 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 && \
# Show any output from the test program whenever the test fails
env CTEST_OUTPUT_ON_FAILURE=1 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 && \
# Show any output from the test program whenever the test fails
env CTEST_OUTPUT_ON_FAILURE=1 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:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
strategy:
fail-fast: false
matrix:
include:
# BCH 2/12/2025: Ubuntu 22.04 is being discontinued, shifting forward
# Ubuntu 22.04 with the oldest supported Qt5 and GCC.
- { os: ubuntu-22.04, qt: 5.9.5, gcc: 9 }
# Ubuntu 22.04 with last official LTS Qt5 and GCC.
- { os: ubuntu-22.04, qt: 5.15.2, gcc: 12 }
# Ubuntu 24.04 with the most recent Qt6 and GCC.
- { os: ubuntu-22.04, qt: 6.8.2, gcc: 12 }
# macos-12 and macos-13 were removed by GitHub,
# so we can't CI with Qt 5.X on macOS any more, oh well
# old macOS with last official LTS Qt5
#- { os: macos-13, qt: 5.15.2 }
# old macOS ARM64 with older Qt6
- { os: macos-14, qt: 6.7.3 }
# macOS Intel with older Qt6
- { os: macos-15-intel, qt: 6.7.3 }
# new macOS with a very recent Qt6
- { os: macos-26, qt: 6.9.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 -DCMAKE_BUILD_TYPE=Release .. && \
make -j 2 && \
# Show any output from the test program whenever the test fails
env CTEST_OUTPUT_ON_FAILURE=1 make test
tests-Windows-GUI:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
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 && \
# Show any output from the test program whenever the test fails
env CTEST_OUTPUT_ON_FAILURE=1 make test
tests-windows-latest-pacman:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
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