forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
96 lines (90 loc) · 2.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
image: registry.gitlab.com/certik/ci-images:conda_base
stages:
- tarball
- build
before_script:
- ci/version.sh
- lfortran_version=$(<version)
prepare tarball:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:prepare-1.2.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
# 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.2.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- sudo apt-get update
- sudo apt-get install -yq --no-install-recommends g++
- 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
# 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.2.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.2.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