forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
143 lines (133 loc) · 3.91 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
stages:
- tarball
- build
before_script:
- ci/version.sh
- lfortran_version=$(<version)
prepare tarball:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:prepare-1.4.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.4.0
script:
- ci/github_mirror.sh
allow_failure: true
only:
- master
# Azure
azure:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:mirror-1.4.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.4.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- ./build1.sh
- pip install .
- 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
# Build and upload documentation
documentation:
stage: build
image: registry.gitlab.com/lfortran/ci-images:documentation-1.4.0
script:
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- ./build1.sh
- sudo pip install .
- 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.4.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.4.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- ./build1.sh
- pip install .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- rm lfort
- sudo apt-get remove -yq gcc 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.4.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- ./build1.sh
- pip install .
- 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 . && 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