-
Notifications
You must be signed in to change notification settings - Fork 157
/
.gitlab-ci.yml
185 lines (172 loc) · 5.18 KB
/
.gitlab-ci.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
stages:
- tarball
- build
before_script:
- ci/version.sh
- lfortran_version=$(<version)
prepare tarball:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:prepare-1.7.0
script:
- export CLASSPATH="$HOME/antlr-4.7-complete.jar:$CLASSPATH"
- ./build0.sh
- python setup.py sdist
- 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
# PyPI upload
pypi:
stage: build
image: registry.gitlab.com/lfortran/ci-images:prepare-1.7.0
script:
- sudo pip install twine
- ci/upload_pypi.sh
#only:
# - master
# - tags
# Azure
azure:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:mirror-1.7.0
script:
- ci/azure_mirror.sh
only:
variables:
- $SSH_PRIVATE_KEY_AZURE
# Test full dependencies when a C compiler is available and used for linking
full:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full-1.7.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- rm lfort
- py.test --pyargs lfortran
- python show_ast.py
- lfort examples/expr2.f90 -o a.out
- ./a.out
- ./test_lfort_cmdline gfortran
- ./test_lfort_cmdline lfort
- ./test_lfort gfortran
- ./test_lfort lfort
- cd tests/interop
- ./run.sh
# 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-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- 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 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"
- export LFORTRAN_CMAKE_GENERATOR="Unix Makefiles"
- export WIN=0
- xonsh ci/build.xsh
# Build and upload documentation
documentation:
stage: build
image: registry.gitlab.com/lfortran/ci-images:jupyter-1.7.0
script:
- sudo apt-get update
- sudo apt-get install -yq --no-install-recommends openssh-client
- export PATH="$HOME/conda_root/bin:$PATH"
- pip install nbconvert mkdocs
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- cd doc
- python convert_nb.py
- mkdocs build -s
- ../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.7.0
script:
- sudo apk add --no-cache curl
- curl -X POST -F token=${DOWNLOAD_UPDATE_TOKEN} -F ref=master https://gitlab.com/api/v4/projects/11905898/trigger/pipeline
only:
- master
# 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-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- export CFLAGS="-I/usr/include/x86_64-linux-musl/"
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- 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 Jupyter notebooks
jupyter:
stage: build
image: registry.gitlab.com/lfortran/ci-images:jupyter-1.7.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- (git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/lfortran/fortran_kernel && cd fortran_kernel && git checkout v0.1.4 && pip install --no-index . && cd .. && rm -r fortran_kernel)
- python -m fortran_kernel.install --sys-prefix
- jupyter kernelspec list --json
- cd share/lfortran/nb
- py.test --pyargs lfortran
- jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output Demo_out.ipynb Demo.ipynb
- ls -l output1.png
artifacts:
paths:
- share/lfortran/nb/Demo_out.ipynb
- share/lfortran/nb/output1.png
when: always