.gitlab-ci.yml 6.24 KB
Newer Older
Martin Bauer's avatar
Martin Bauer committed
1
stages:
2
  - pretest
Martin Bauer's avatar
Martin Bauer committed
3
4
5
6
  - test
  - deploy


7
# --------------------------  Pre Tests --------------------------------------------------------------------------------
Martin Bauer's avatar
Martin Bauer committed
8
9
10

# Normal test - runs on every commit all but "long run" tests
tests-and-coverage:
11
  stage: pretest
Martin Bauer's avatar
Martin Bauer committed
12
13
14
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
15
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
16
  script:
17
18
    - env
    - pip list
Martin Bauer's avatar
Martin Bauer committed
19
20
21
22
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - mkdir public
Martin Bauer's avatar
Martin Bauer committed
23
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
24
25
    - env
    - pip list
26
27
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --junitxml=report.xml
    - python3 -m coverage xml
Martin Bauer's avatar
Martin Bauer committed
28
29
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
30
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
31
32
33
34
35
    - AVX
  artifacts:
    when: always
    paths:
      - coverage_report
36
37
38
    reports:
      cobertura: coverage.xml
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed
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
minimal-conda:
  stage: pretest
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/minimal_conda
  script:
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
    - python setup.py quicktest
  tags:
    - docker

# Linter for code formatting
flake8-lint:
  stage: pretest
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  script:
    - flake8 lbmpy
  tags:
    - docker
    - cuda11

# -------------------------- Tests -------------------------------------------------------------------------------------

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
# pipeline with latest python version
latest-python:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/latest_python
  before_script:
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
  script:
    - env
    - pip list
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - mkdir public
    - py.test -v -n $NUM_CORES -m "not longrun" --junitxml=report.xml
  tags:
    - docker
    - AVX
  artifacts:
    when: always
    reports:
      junit: report.xml

Martin Bauer's avatar
Martin Bauer committed
92
93
94
95
96
97
# Nightly test  - runs "long run" jobs only
test-longrun:
  stage: test
  only:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
98
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
99
  script:
100
101
    - env 
    - pip list
Martin Bauer's avatar
Martin Bauer committed
102
103
104
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
105
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
106
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --junitxml=report.xml
Martin Bauer's avatar
Martin Bauer committed
107
108
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
109
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
110
111
    - AVX
  artifacts:
112
    when: always
Martin Bauer's avatar
Martin Bauer committed
113
114
    paths:
      - coverage_report
115
116
    reports:
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed
117
118
119
120
121
122
123
124
125
126

# Minimal tests in windows environment
minimal-windows:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  tags:
    - win
  script:
127
128
    - export NUM_CORES=$(nproc --all)
    - export MPLBACKEND=Agg
Martin Bauer's avatar
Martin Bauer committed
129
    - source /cygdrive/c/Users/build/Miniconda3/Scripts/activate
Markus Holzer's avatar
Markus Holzer committed
130
    - source activate pystencils
Martin Bauer's avatar
Martin Bauer committed
131
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
132
    - env
Markus Holzer's avatar
Markus Holzer committed
133
    - pip list
Martin Bauer's avatar
Martin Bauer committed
134
    - python -c "import numpy"
135
    - py.test -v -n $NUM_CORES -m "not (notebook or longrun)"
Martin Bauer's avatar
Martin Bauer committed
136

137
ubuntu:
Martin Bauer's avatar
Martin Bauer committed
138
139
140
141
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
142
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
143
144
145
  before_script:
    - apt-get -y remove python3-sympy
    - ln -s /usr/include/locale.h /usr/include/xlocale.h
Markus Holzer's avatar
Markus Holzer committed
146
    - pip3 install `grep -Eo 'sympy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'`
147
148
149
    - pip3 install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
  script:
    - export NUM_CORES=$(nproc --all)
150
151
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
152
153
    - env
    - pip3 list
154
    - pytest-3 -v -n $NUM_CORES -m "not longrun" --junitxml=report.xml
Martin Bauer's avatar
Martin Bauer committed
155
156
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
157
    - cuda11
158
159
160
161
  artifacts:
    when: always
    reports:
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed
162

163
164
165
166
pycodegen-integration:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  stage: test
  when: manual
Markus Holzer's avatar
Markus Holzer committed
167
  allow_failure: true
168
  script:
169
170
    - env
    - pip list
171
172
173
174
175
176
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pycodegen.git
    - cd pycodegen
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git submodule foreach git fetch origin   # compare the latest master version!
    - git submodule foreach git reset --hard origin/master
Markus Holzer's avatar
Markus Holzer committed
177
178
179
180
181
182
183
    - cd lbmpy
    - git remote add test $CI_REPOSITORY_URL
    - git fetch test
    - git reset --hard $CI_COMMIT_SHA
    - cd ..
    - pip install -e pystencils/
    - pip install -e lbmpy/
184
    - ./install_walberla.sh
Frederik Hennig's avatar
Frederik Hennig committed
185
186
187
    # build all integration tests
    - cd walberla/build/
    - make -j $NUM_CORES MicroBenchmarkGpuLbm LbCodeGenerationExample
188
189
190
191
    - cd apps/benchmarks/UniformGridGPU
    - make -j $NUM_CORES
    - cd ../UniformGridGenerated
    - make -j $NUM_CORES
Markus Holzer's avatar
Markus Holzer committed
192

193
194
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
195
    - cuda11
196
    - AVX
Martin Bauer's avatar
Martin Bauer committed
197

198
# -------------------- Documentation and deploy ------------------------------------------------------------------------
Martin Bauer's avatar
Martin Bauer committed
199
200
201

build-documentation:
  stage: test
202
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
203
204
  script:
    - export PYTHONPATH=`pwd`
Martin Bauer's avatar
Martin Bauer committed
205
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
Martin Bauer's avatar
Martin Bauer committed
206
    - mkdir html_doc
Markus Holzer's avatar
Markus Holzer committed
207
    - sphinx-build -W -b html doc html_doc
Martin Bauer's avatar
Martin Bauer committed
208
209
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
210
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
211
212
213
214
215
216
  artifacts:
    paths:
      - html_doc


pages:
217
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
218
219
220
221
222
223
224
225
226
227
228
229
  stage: deploy
  script:
    - ls -l
    - mv coverage_report html_doc
    - mv html_doc public  # folder has to be named "public" for gitlab to publish it
  artifacts:
    paths:
      - public
  tags:
    - docker
  only:
    - master@pycodegen/lbmpy