forked from lfortran/lfortran
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci-old.yml
366 lines (341 loc) · 10.4 KB
/
.gitlab-ci-old.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
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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
stages:
- tarball
- build
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_COMMIT_TAG'
prepare tarball:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:prepare-1.7.0
variables:
# Both of these variables are needed, so that `git describe` can see the
# recent tags
GIT_FETCH_EXTRA_FLAGS: --tags --prune --prune-tags
GIT_DEPTH: 0 # fetch all commits and tags
script:
- ./build0.sh
- lfortran_version=$(<version)
- sudo apk add --no-cache cmake
- ci/create_source_tarball.sh $lfortran_version
- ci/upload_tarball.sh
artifacts:
paths:
- dist/*
when: always
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://gitlab.com/lfortran/packages/testing/tree/$CI_COMMIT_REF_NAME
# GitHub mirror
mirror:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:mirror-1.7.0
script:
- ci/github_mirror.sh
allow_failure: true
only:
- master
- tags
# Azure
azure:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:mirror-1.7.0
script:
- ci/azure_mirror.sh
allow_failure: true
only:
variables:
- $SSH_PRIVATE_KEY_AZURE
# Test the C++ version
cxx:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full-1.7.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- conda install -c conda-forge rapidjson
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- CXXFLAGS="-Werror" cmake
-DCMAKE_PREFIX_PATH=$HOME/conda_root
-DCMAKE_INSTALL_PREFIX=`pwd`
-DCMAKE_BUILD_TYPE=Debug
-DWITH_JSON=yes
.
- cmake --build . --target install
- ctest --output-on-failure
- ./src/bin/parse
# Test the C++ version
libasr:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full-1.7.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- conda install -c conda-forge rapidjson
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- mkdir build
- cd build
- mv ../src/libasr .
- cd libasr
- CXXFLAGS="-Werror" cmake
-DCMAKE_PREFIX_PATH=$HOME/conda_root
-DCMAKE_INSTALL_PREFIX=`pwd`
-DCMAKE_BUILD_TYPE=Debug
.
- cmake --build .
# Create a binary tarball with the C++ based LFortran
cxx_binary:
stage: build
image: registry.gitlab.com/lfortran/ci-images:cxxbinary-1.10.0
script:
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- CXXFLAGS="-Werror" cmake
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -march=nehalem -funroll-loops -DNDEBUG"
-DWITH_LLVM=yes
-DLFORTRAN_STATIC_BIN=yes
.
- make
- ctest --output-on-failure
- cpack
artifacts:
paths:
- lfortran-*/lfortran-*-Linux.tar.bz2
when: always
# Test LLVM
cxx_binary_tests:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full2-1.7.0
script:
- export CONDA_PREFIX="$HOME/conda_root"
- export PATH="$HOME/conda_root/bin:$PATH"
- conda install -c conda-forge toml lld=11.0.1 llvmdev=11.0.1
- sudo apt-get update
- sudo apt-get install -yq --no-install-recommends git libtinfo-dev zlib1g-dev binutils-dev
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- CXXFLAGS="-Werror" cmake
-DCMAKE_BUILD_TYPE=Debug
-DWITH_LLVM=yes
-DWITH_STACKTRACE=yes
.
- make
- ctest --output-on-failure
- cp src/bin/lfortran ../src/bin/
- cp src/bin/cpptranslate ../src/bin/
- export LFORTRAN_RUNTIME_LIBRARY_DIR="`pwd`/src/runtime"
- cd ..
- ./run_tests.py
- PATH="`pwd`/src/bin:$PATH" ./test_lfortran_cmdline lfortran
- cd src/runtime/tests
- CXXFLAGS="-Werror" cmake .
- make
- ctest --output-on-failure
- cd ../../..
- cd integration_tests
- mkdir build-gfortran
- cd build-gfortran
- FC=gfortran cmake ..
- make
- ctest -L gfortran --output-on-failure
- cd ..
- mkdir build-lfortran-llvm
- cd build-lfortran-llvm
- FC=../../src/bin/lfortran cmake -DLFORTRAN_BACKEND=llvm ..
- make
- ctest -L llvm --output-on-failure
- cd ..
- mkdir build-lfortran-x86
- cd build-lfortran-x86
- FC=../../src/bin/lfortran cmake -DLFORTRAN_BACKEND=x86 ..
- make
- ctest -L x86 --output-on-failure
- cd ..
- mkdir build-lfortran-cpp
- cd build-lfortran-cpp
- wget https://github.com/kokkos/kokkos/archive/3.1.01.tar.gz
- tar xaf 3.1.01.tar.gz
- cd kokkos-3.1.01
- mkdir build
- cd build
- export LFORTRAN_KOKKOS_DIR=$HOME/ext/kokkos
- cmake -DCMAKE_INSTALL_PREFIX=$LFORTRAN_KOKKOS_DIR -DKokkos_ENABLE_OPENMP=On -DKokkos_ARCH_HSW=On ..
- make
- make install
- cd ..
- cd ..
- FC=../../src/bin/lfortran FFLAGS="--openmp" cmake -DLFORTRAN_BACKEND=cpp ..
- make
- ctest -L cpp --output-on-failure
- cd ../..
- cd examples/project1
- FC=../../src/bin/lfortran FFLAGS="--openmp --backend=cpp" cmake .
- make
- ./project1
- git config --global --add safe.directory /builds/lfortran/lfortran
- git config --global --add safe.directory /builds/certik/lfortran
- git config --global --add safe.directory /builds/richardblam/lfortran
- git clean -dfx
- FC=../../src/bin/lfortran cmake .
- make
- ./project1
- cd ../..
- cd examples/project2
- FC=../../src/bin/lfortran FFLAGS="--openmp --backend=cpp" cmake .
- make
- ./doconcurrent
- cd ../..
# Test Jupyter Kernel
jupyter_kernel:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full3-1.11.0
script:
- export CONDA_PREFIX="$HOME/conda_root"
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- CXXFLAGS="-Werror" cmake
-DCMAKE_BUILD_TYPE=Debug
-DWITH_LLVM=yes
-DWITH_XEUS=yes
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
.
- make
- make install
- ctest --output-on-failure
- cd ..
- jupyter kernelspec list --json
- python ci/test_fortran_kernel.py -v
- cd share/lfortran/nb
- jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output Demo1_out.ipynb Demo1.ipynb
- jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output Demo2_out.ipynb Demo2.ipynb
artifacts:
paths:
- share/lfortran/nb/Demo1_out.ipynb
- share/lfortran/nb/Demo2_out.ipynb
when: always
# Test LFortran without the LLVM backend
cxx_binary_min:
stage: build
image: registry.gitlab.com/lfortran/ci-images:cxxbinary-1.8.0
script:
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- CXXFLAGS="-Werror" cmake
-DCMAKE_BUILD_TYPE=Debug
.
- make
- ctest --output-on-failure
# Test LFortran without the LLVM backend and run tests
cxx_binary_min_tests:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full2-1.7.0
script:
- export CONDA_PREFIX="$HOME/conda_root"
- export PATH="$HOME/conda_root/bin:$PATH"
- conda install -c conda-forge toml
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- CXXFLAGS="-Werror" cmake
-DCMAKE_BUILD_TYPE=Debug
.
- make
- ctest --output-on-failure
- cp src/bin/lfortran ../src/bin/
- cp src/bin/cpptranslate ../src/bin/
- cp src/runtime/*.mod ../src/runtime/
- cd ..
- ./run_tests.py --no-llvm
# Test the multiplatform build script
build.xsh:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full2-1.7.0
script:
- export CONDA_PREFIX="$HOME/conda_root"
- export PATH="$HOME/conda_root/bin:$PATH"
- sudo apt-get update
- sudo apt-get install -yq --no-install-recommends zlib1g-dev git
- git config --global --add safe.directory /builds/lfortran/lfortran
- git config --global --add safe.directory /builds/certik/lfortran
- git config --global --add safe.directory /builds/richardblam/lfortran
- git config --global --add safe.directory /builds/czgdp18071/lfortran
- conda install -c conda-forge llvmdev=11.0.1 toml pytest jupyter xeus=1.0.1 xtl nlohmann_json cppzmq jupyter_kernel_test
- export LFORTRAN_CMAKE_GENERATOR="Unix Makefiles"
- export WIN=0
- export MACOS=0
- rm -rf dist
- xonsh ci/build.xsh
# Build and upload documentation
documentation:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full3-1.11.0
script:
- sudo apt-get update
- sudo apt-get install -yq --no-install-recommends openssh-client git
- export CONDA_PREFIX="$HOME/conda_root"
- export PATH="$HOME/conda_root/bin:$PATH"
- conda install -c conda-forge nbconvert=5.6.0 mkdocs=1.3.0
- pip install mkdocs-material==8.2.16
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- CXXFLAGS="-Werror" cmake
-DCMAKE_BUILD_TYPE=Debug
-DWITH_LLVM=yes
-DWITH_XEUS=yes
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
.
- make
- make install
- ctest --output-on-failure
- cd ..
- jupyter kernelspec list --json
- rm -r lfortran-*
- cd doc
- python convert_nb.py
- mkdocs build
- ../ci/upload_docs.sh
artifacts:
paths:
- doc/site
when: always
# Update the downloads page
downloads_update:
stage: build
image: registry.gitlab.com/lfortran/ci-images:prepare-1.8.0
script:
- curl -X POST -F token=${DOWNLOAD_UPDATE_TOKEN} -F ref=master https://gitlab.com/api/v4/projects/11905898/trigger/pipeline
only:
- master
- tags
# Test minimal dependencies needed to get things to run. No gcc or clang
# compilers, just the linker `ld` and the musl C library.
minimal:
stage: build
image: registry.gitlab.com/lfortran/ci-images:minimal-1.7.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-*.tar.gz
- cd lfortran-*
- export CFLAGS="-I/usr/include/x86_64-linux-musl/"
#- pip install --no-index -v .
#- cd ..
#- rm -r lfortran lfortran-*
#- rm lfort
- sudo apt-get remove -yq gcc g++ libc6-dev
- sudo apt-get autoremove -yq
#- py.test --pyargs lfortran
#- lfort --ld-musl examples/expr2.f90 -o a.out
#- ./a.out
# Test Bison grammar
grammar:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full2-1.7.0
script:
- sudo apt-get update
- sudo apt-get install -yq --no-install-recommends patch bison
- ci/grammar_conflicts.sh