-
Notifications
You must be signed in to change notification settings - Fork 24
272 lines (245 loc) · 8.59 KB
/
Casal2_testsuite_modelrunner_archive.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
name: Casal2 validate test suite
on:
push:
branches:
- master # age_length_redesign_202109
pull_request:
branches:
- master ## this will run actions on current branch, to change to main, needed for testing. all branches '*'
## taken from https://keithweaverca.medium.com/only-run-github-actions-on-specific-branches-694782fcc07
## for a release idea linux is fairly easy
## for windows look at this example https://github.com/freenet/wininstaller-innosetup/actions/runs/768471071/workflow
jobs:
Compile-Casal2-Linux:
# should run on linux based operating system
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-latest
timeout-minutes: 180
env:
CC: gcc-12
CXX: g++-12
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
python-version: '3.8'
- name: Install python dependencies
run: pip install pytz python-dateutil --user --upgrade pip
- name: Install gcc
uses: egor-tensin/setup-gcc@v1
with:
version: 10
platform: x86
- name: Build third-party library - release
run: |
cd BuildSystem
./doBuild.sh thirdparty
- name: Build third-party library - adolc
run: |
cd BuildSystem
./doBuild.sh thirdparty adolc
- name: Build third-party library - betadiff
run: |
cd BuildSystem
./doBuild.sh thirdparty betadiff
- name: Build third-party libraries - boost
run: |
cd BuildSystem
./doBuild.sh thirdparty boost
- name: Build third-party libraries - google test and mock
run: |
cd BuildSystem
./doBuild.sh thirdparty googletest_googlemock
- name: Build third-party libraries - parser
run: |
cd BuildSystem
./doBuild.sh thirdparty parser
- name: Build release library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library release
- name: Build "Betadiff" library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library betadiff
- name: Build "ADOL-C" library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library adolc
- name: Build "Unit Test" library
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh library test
- name: Build Frontend
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh frontend
shell: bash
- name: Build Linux Archive
continue-on-error: true
run: |
cd BuildSystem
export CASAL2_BUILD_THREADS=16
./doBuild.sh archive true
shell: bash
- name: Archive Linux build
continue-on-error: true
uses: actions/[email protected]
with:
name: Casal2-Linux-build
path: BuildSystem/Casal2
- name: Run Linux model runner
continue-on-error: true
run: |
cd BuildSystem
./doBuild.sh modelrunner
- name: Archive modelrunner
continue-on-error: true
uses: actions/[email protected]
with:
name: Casal2-Linux-modelrunner
path: TestModels/
- name: Run Unit Tests from frontend build
run: |
cd BuildSystem/Casal2
./casal2 --unittest > unittests.log
- name: Archive unittest output
continue-on-error: true
uses: actions/[email protected]
with:
name: Casal2-Linux-unittest
path: BuildSystem/Casal2/unittests.log
Base-R-Ubuntu:
needs: Compile-Casal2-Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: R-libraries/casal2
extra-packages: |
any::devtools
any::bayesplot
any::purrr
any::DHARMa
any::mvtnorm
dependencies: '"hard"'
- name: Install Casal2 base
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/settings/tokens
run: Rscript -e 'devtools::install_github("https://github.com/NIWAFisheriesModelling/CASAL2", subdir="R-libraries/casal2", ref = "HEAD")'
## download model runs
- name: Download TestModels artifact
uses: actions/[email protected]
with:
# Artifact name
name: Casal2-Linux-modelrunner # optional
# Destination path
path: CheckTestModels # optional
## now run an R script that will check R-library compatible with exe output
- name: Run Casal2 R test suite
run: Rscript -e 'source(file.path("R-libraries","run_rlibrary_tests.R"))'
Compile-Casal2-Windows:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: windows-2019
timeout-minutes: 180
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
python-version: '3.8'
- name: Install python dependencies
run: python.exe -m pip install pytz python-dateutil --user --upgrade pip
- name: Install gcc
uses: bwoodsend/setup-winlibs-action@v1
with:
# see https://github.com/marketplace/actions/setup-winlibs
# and https://github.com/brechtsanders/winlibs_mingw/tags
#tag: '10.3.0-12.0.0-9.0.0-r2'
tag: '10.3.1-snapshot20211112-9.0.0-ucrt-r1' # previous tag as of 2022-03-31
#tag: '11.1.0-12.0.0-9.0.0-r1' # reference tag in documentation
#tag: '11.2.1-snapshot20220219-9.0.0-ucrt-r1' # caused issues with Casal2 unit tests
#tag: '12.0.1-snapshot20220123-9.0.0-msvcrt-r1'
- name: Build third-party library - adolc
run: |
cd BuildSystem
./doBuild.bat thirdparty adolc
- name: Build third-party library - betadiff
run: |
cd BuildSystem
./doBuild.bat thirdparty betadiff
- name: Build third-party library - boost
run: |
cd BuildSystem
./doBuild.bat thirdparty boost
- name: Build third-party libraries - google test and mock
run: |
cd BuildSystem
./doBuild.bat thirdparty googletest_googlemock
- name: Build third-party libraries - parser
run: |
cd BuildSystem
./doBuild.bat thirdparty parser
- name: Build release library
run: |
cd BuildSystem
./doBuild.bat library release
- name: Build "Betadiff" library
run: |
cd BuildSystem
./doBuild.bat library betadiff
- name: Build "ADOL-C" library
run: |
cd BuildSystem
./doBuild.bat library adolc
- name: Build "Unit Test" library
run: |
cd BuildSystem
./doBuild.bat library test
- name: Build Frontend
run: |
cd BuildSystem
./doBuild.bat frontend
shell: bash
- name: Build Windows Archive
continue-on-error: true
run: |
cd BuildSystem
./doBuild.bat archive true
shell: bash
- name: Archive Windows build
continue-on-error: true
uses: actions/[email protected]
with:
name: Casal2-Windows-build
path: BuildSystem/Casal2
- name: Run Windows model runner
continue-on-error: true
run: |
cd BuildSystem
./doBuild.bat modelrunner
- name: Archive Windows modelrunner
continue-on-error: true
uses: actions/[email protected]
with:
name: Casal2-Windows-modelrunner
path: TestModels/
- name: Run Unit Tests from frontend application
continue-on-error: false
run: |
cd BuildSystem/Casal2
./casal2 --unittest > unittests.log
- name: Archive unittest output
continue-on-error: true
uses: actions/[email protected]
with:
name: Casal2-Windows-unittest
path: BuildSystem/Casal2/unittests.log