-
Notifications
You must be signed in to change notification settings - Fork 39
228 lines (201 loc) · 6.94 KB
/
make.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
# Build and test MAD-X on several platforms using GNU make.
#
# TODO:
# - follow up on the following issues and re-enable the corresponding settings:
# - ubuntu-18.04: test failures: test-survey-3 test-thick-quad-2 test-track-9
# - ubuntu-20.04: internal compiler error
# - windows-latest: test failures: test-match-10
# - coverage: enable on windows/macos (internal compiler error)
name: make
on:
push:
pull_request:
env:
# Without this, tons of tests fail due to incorrect output ordering...
# Someone should take a look why the code in mad_main.c doesn't work?
GFORTRAN_UNBUFFERED_PRECONNECTED: y
jobs:
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
flags:
- i=1 STATIC=yes ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no
- i=2 STATIC=no ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=yes
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
set -ex
sudo apt-get update
sudo apt-get install -qy \
libblas-dev \
liblapack-dev \
gfortran \
gnuplot
pip install cpp-coveralls
- name: Build MAD-X
run: |
set -ex
make madx-linux$ARCH-gnu ${{ matrix.flags }} COVERAGE=yes
# numdiff must be built without COVERAGE to avoid linker errors:
make numdiff-linux$ARCH-gnu ${{ matrix.flags }} COVERAGE=no
env:
ARCH: ${{ contains(matrix.flags, 'ARCH=32') && '32' || '64' }}
- name: Upload artifact executable
if: matrix.os == ' ubuntu-22.04' && matrix.flags == 'i=1 STATIC=yes ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no'
uses: actions/upload-artifact@v3
with:
name: madx-linux64
path: madx-linux64-gnu
- name: Run tests
id: tests
# TODO: debug why these 3 tests are failing, and re-enable:
run: |
.github/utils/make_tests ${{
matrix.os == 'ubuntu-18.04'
&& 'tests-to-rm="test-survey-3 test-thick-quad-2 test-track-9"'
|| ''
}}
- name: Set artifact name suffix
if: failure() && steps.tests.outcome == 'failure'
id: jobname
run: |
${{ matrix.flags }}
.github/utils/set-output i $i
- name: Upload test outputs for inspection
# This below condition looks redundant - but there is something about
# the failure() and always() functions that prevents an implicit
# `if success()` that would otherwise be conditioned on.
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: failures-${{ matrix.os }}-${{ steps.jobname.outputs.i }}
path: |
tests/tests-log.txt
tests/tests-summary.txt
${{ steps.tests.outputs.failed-tests }}
- name: Upload coverage results
if: env.COVERALLS_REPO_TOKEN != ''
run: coveralls --include src -x .c -x .cpp
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
macos:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
flags:
- i=1 STATIC=no ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no
- i=2 STATIC=yes ONLINE=no NTPSA=yes USEGC=yes ARCH=64 X11=no
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
brew install gnuplot
- name: Setup gcc/gfortran
run: |
ls /usr/local/bin/gfortran*
set -ex
sudo ln -s $(which gcc-12) /usr/local/bin/gcc
sudo ln -s $(which g++-12) /usr/local/bin/g++
sudo ln -s $(which gfortran-12) /usr/local/bin/gfortran
- name: Build MAD-X
run: |
set -ex
# COVERAGE=yes currently fails with internal compiler error in
# match.f90:1917:0:
make madx-macosx$ARCH-gnu ${{ matrix.flags }} COVERAGE=no
make numdiff-macosx$ARCH-gnu ${{ matrix.flags }} COVERAGE=no
env:
ARCH: ${{ contains(matrix.flags, 'ARCH=32') && '32' || '64' }}
- name: Upload artifact executable
uses: actions/upload-artifact@v3
with:
name: madx-macosx
path: madx-macosx64-gnu
- name: Run tests
id: tests
run: |
.github/utils/make_tests
- name: Set artifact name suffix
if: failure() && steps.tests.outcome == 'failure'
id: jobname
run: |
${{ matrix.flags }}
.github/utils/set-output i $i
- name: Upload test outputs for inspection
# This below condition looks redundant - but there is something about
# the failure() and always() functions that prevents an implicit
# `if success()` that would otherwise be conditioned on.
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: failures-${{ matrix.os }}-${{ steps.jobname.outputs.i }}
path: |
tests/tests-log.txt
tests/tests-summary.txt
${{ steps.tests.outputs.failed-tests }}
windows:
runs-on: windows-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- bits: 32
arch: i686
- bits: 64
arch: x86_64
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: MINGW${{ matrix.bits }}
install: >-
base-devel
mingw-w64-${{ matrix.arch }}-toolchain
- name: Build MAD-X
run: make all-win${{ matrix.bits }}-gnu
- name: Upload artifact executable
uses: actions/upload-artifact@v3
with:
name: madx-windows
path: |
build
madx-win64-gnu.exe
- name: Run tests
# Skip 32bit build - it's broken and mind-boggelingly slow (>>2h)!
if: matrix.bits != 32
id: tests
run: |
# TODO: fix test-match-10 failure and reenable
.github/utils/make_tests \
tests-to-rm="test-plot test-match-10 test-read-write-hex" \
ARCH=${{ matrix.bits }}
- name: Upload failed tests output for inspection
# Keep the redundant condition (see above)!
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: failures-win${{ matrix.bits }}
path: |
tests/tests-log.txt
tests/tests-summary.txt
${{ steps.tests.outputs.failed-tests }}