forked from nest/nest-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
270 lines (242 loc) · 10.1 KB
/
nestbuildmatrix.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
#
# detailed syntax defined in
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
name: "NEST matrix jobs"
env:
CXX_FLAGS: "-pedantic -Wextra -Woverloaded-virtual -Wno-unknown-pragmas"
PYTHONPATH: ${{ github.workspace }}/build/python
on: [push, pull_request]
jobs:
static_checks:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
env:
xNEST_BUILD_TYPE: "STATIC_CODE_ANALYSIS"
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout repository content"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: "Restore apt cache"
uses: actions/cache@v2
env:
cache-name: "apt-cache"
with:
path: |
!/var/cache/apt/archives/lock
!/var/cache/apt/archives/partial
/var/cache/apt
key: ${{ runner.os }}-system-${{ env.cache-name }}-${{ hashFiles('**/environment.yml') }}
restore-keys: |
${{ runner.os }}-system-${{ env.cache-name }}-
${{ runner.os }}-system-
- name: "Install Linux system dependencies"
run: |
sudo apt-get update
#https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
sudo apt-get install libltdl-dev libreadline6-dev libncurses5-dev libgsl0-dev python3-all-dev jq pycodestyle libpcre3 libpcre3-dev libboost-all-dev
sudo apt-get install openmpi-bin libopenmpi-dev libgsl0-dev tcl8.6 tcl8.6-dev tk8.6-dev
sudo apt-get install libboost-filesystem-dev libboost-regex-dev libboost-wave-dev libboost-python-dev libboost-program-options-dev libboost-test-dev
sudo apt-get install vera++
sudo ldconfig
g++ --version
- name: "Restore pip cache"
env:
cache-name: "pip-cache"
uses: actions/cache@v2
with:
path: |
/opt/hostedtoolcache/Python/**/site-packages/*
$HOME/.cache/pip
key: ${{ runner.os }}-python-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ env.cache-name }}-
${{ runner.os }}-python-
- name: "Install Python dependencies"
run: |
python -m pip install --upgrade pip setuptools
# --force-reinstall required to ensure executable is linked from bin dir in PATH
python -m pip install --force-reinstall clang-format==13.0
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc pandas
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
- name: "Find changed files"
run: |
echo "CHANGED_FILES<<EOF" >> $GITHUB_ENV
echo "$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.after }})" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
echo "GITHUB_ENV = $GITHUB_ENV"
cat $GITHUB_ENV
- name: "Static Code Analysis"
run: build_support/ci_build.sh
env:
xNEST_BUILD_TYPE: 'STATIC_CODE_ANALYSIS'
CHANGED_FILES: ${{ env.CHANGED_FILES }}
test_linux:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
runs-on: ${{ matrix.os }}
needs: [static_checks]
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
cpp_compiler: ["gcc", "clang"]
xNEST_BUILD_TYPE: ["MINIMAL", "MPI_ONLY", "OPENMP_ONLY", "FULL"]
exclude:
- xNEST_BUILD_TYPE: "MINIMAL"
cpp_compiler: "clang"
os: "ubuntu-20.04"
- xNEST_BUILD_TYPE: "MPI_ONLY"
cpp_compiler: "clang"
os: "ubuntu-20.04"
- xNEST_BUILD_TYPE: "OPENMP_ONLY"
cpp_compiler: "clang"
os: "ubuntu-20.04"
- xNEST_BUILD_TYPE: "FULL"
cpp_compiler: "clang"
os: "ubuntu-20.04"
steps:
- name: "Checkout repository content"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Find changed files"
run: |
echo "CHANGED_FILES<<EOF" >>$GITHUB_ENV
echo "$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})" >>$GITHUB_ENV
echo 'EOF' >>$GITHUB_ENV
- name: "Set up Python 3.x"
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: "Restore apt cache"
uses: actions/cache@v2
env:
cache-name: "apt-cache"
with:
path: |
!/var/cache/apt/archives/lock
!/var/cache/apt/archives/partial
/var/cache/apt
key: ${{ runner.os }}-system-${{ env.cache-name }}-${{ hashFiles('**/environment.yml') }}
restore-keys: |
${{ runner.os }}-system-${{ env.cache-name }}-
${{ runner.os }}-system-
- name: "Install Linux system dependencies"
run: |
sudo apt-get update
#https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
sudo apt-get install libltdl-dev libreadline6-dev libncurses5-dev libgsl0-dev python3-all-dev jq pycodestyle libpcre3 libpcre3-dev libboost-all-dev
sudo apt-get install openmpi-bin libopenmpi-dev libgsl0-dev tcl8.6 tcl8.6-dev tk8.6-dev
sudo apt-get install libboost-filesystem-dev libboost-regex-dev libboost-wave-dev libboost-python-dev libboost-program-options-dev libboost-test-dev
sudo apt-get install vera++
sudo ldconfig
g++ --version
- name: "Restore pip cache"
env:
cache-name: "pip-cache"
uses: actions/cache@v2
with:
path: |
/opt/hostedtoolcache/Python/**/site-packages/*
$HOME/.cache/pip
key: ${{ runner.os }}-python-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ env.cache-name }}-
${{ runner.os }}-python-
- name: "Install Python dependencies"
run: |
python -m pip install --upgrade pip setuptools
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc pandas
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
- name: "Build NEST"
run: |
./build_support/ci_build.sh 2>&1 | tee ci_build.sh.log
python build_support/parse_build_log.py ci_build.sh.log ${{ github.workspace }}
env:
xNEST_BUILD_TYPE: ${{ matrix.xNEST_BUILD_TYPE }}
CHANGED_FILES: ${{ env.CHANGED_FILES }}
#get changed files: https://github.com/marketplace/actions/get-changed-files
- name: "Upload install and test results"
uses: actions/upload-artifact@v2
if: always()
with:
name: "test_linux-${{ matrix.os }}-${{ matrix.cpp_compiler }}-${{ matrix.xNEST_BUILD_TYPE }}-logs"
path: |
ci_build.sh.log
install_manifest.txt
**.log
build/reports/**
test_macos:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
runs-on: ${{ matrix.os }}
needs: [static_checks]
strategy:
fail-fast: false
matrix:
os: [macos-latest]
cpp_compiler: ["clang"]
xNEST_BUILD_TYPE: ["FULL_MACOS"]
steps:
- name: "Checkout repository content"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Find changed files"
run: |
echo "CHANGED_FILES<<EOF" >>$GITHUB_ENV
echo "$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})" >>$GITHUB_ENV
echo 'EOF' >>$GITHUB_ENV
- name: "Set up Python 3.x"
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: "Install MacOS system dependencies"
run: |
brew install coreutils gsl open-mpi libomp automake autoconf libtool boost
brew info python
- name: "Restore pip cache"
env:
cache-name: "pip-cache"
uses: actions/cache@v2
with:
path: |
/opt/hostedtoolcache/Python/**/site-packages/*
$HOME/.cache/pip
key: ${{ runner.os }}-python-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ env.cache-name }}-
${{ runner.os }}-python-
- name: "Install Python dependencies"
run: |
python -m pip install --upgrade pip setuptools
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy "junitparser>=2" numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc pandas
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
- name: "Build NEST"
run: |
./build_support/ci_build.sh 2>&1 | tee ci_build.sh.log
python build_support/parse_build_log.py ci_build.sh.log ${{ github.workspace }}
env:
xNEST_BUILD_TYPE: ${{ matrix.xNEST_BUILD_TYPE }}
CHANGED_FILES: ${{ env.CHANGED_FILES }}
#get changed files: https://github.com/marketplace/actions/get-changed-files
- name: "Upload install and test results"
uses: actions/upload-artifact@v2
if: always()
with:
name: "test_macos-${{ matrix.os }}-${{ matrix.cpp_compiler }}-${{ matrix.xNEST_BUILD_TYPE }}-logs"
path: |
ci_build.sh.log
install_manifest.txt
**.log
build/reports/**