.gitlab-ci.yml 5.26 KB
Newer Older
Martin Bauer's avatar
Martin Bauer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
stages:
  - test
  - deploy


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

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

# Nightly test  - runs "long run" jobs only
test-longrun:
  stage: test
  only:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
45
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
46
  script:
47
48
    - env 
    - pip list
Martin Bauer's avatar
Martin Bauer committed
49
50
51
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
52
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
53
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --junitxml=report.xml
Martin Bauer's avatar
Martin Bauer committed
54
55
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
56
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
57
58
    - AVX
  artifacts:
59
    when: always
Martin Bauer's avatar
Martin Bauer committed
60
61
    paths:
      - coverage_report
62
63
    reports:
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed
64
65
66
67
68
69
70
71
72
73
74
75
76
77

# Minimal tests in windows environment
minimal-windows:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  tags:
    - win
  script:
    - source /cygdrive/c/Users/build/Miniconda3/Scripts/activate
    - source activate pystencils_dev
    - env
    - conda env list
Martin Bauer's avatar
Martin Bauer committed
78
    - 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
79
80
81
    - python -c "import numpy"
    - python setup.py quicktest

82
ubuntu:
Martin Bauer's avatar
Martin Bauer committed
83
84
85
86
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
87
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
Martin Bauer's avatar
Martin Bauer committed
88
  script:
Markus Holzer's avatar
Markus Holzer committed
89
90
    - pip3 install `grep -Eo 'sympy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'`
    - pip3 install `grep -Eo 'numpy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'`
91
92
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
93
    - pip3 install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
94
95
    - env
    - pip3 list
96
    - pytest-3 -v -m "not longrun" --junitxml=report.xml
Martin Bauer's avatar
Martin Bauer committed
97
98
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
99
    - cuda11
100
101
102
103
  artifacts:
    when: always
    reports:
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed
104
105
106
107
108
109

minimal-conda:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
110
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/minimal_conda
Martin Bauer's avatar
Martin Bauer committed
111
  script:
Martin Bauer's avatar
Martin Bauer committed
112
    - 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
113
114
115
116
    - python setup.py quicktest
  tags:
    - docker

117
118
119
120
pycodegen-integration:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  stage: test
  when: manual
Markus Holzer's avatar
Markus Holzer committed
121
  allow_failure: true
122
  script:
123
124
    - env
    - pip list
125
126
127
128
129
130
    - 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
131
132
133
134
135
136
137
    - 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/
138
    - ./install_walberla.sh
Frederik Hennig's avatar
Frederik Hennig committed
139
140
141
    # build all integration tests
    - cd walberla/build/
    - make -j $NUM_CORES MicroBenchmarkGpuLbm LbCodeGenerationExample
142
143
144
145
    - cd apps/benchmarks/UniformGridGPU
    - make -j $NUM_CORES
    - cd ../UniformGridGenerated
    - make -j $NUM_CORES
Markus Holzer's avatar
Markus Holzer committed
146

147
148
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
149
    - cuda11
150
    - AVX
Martin Bauer's avatar
Martin Bauer committed
151
152
153
154
155
156
157
158
159

# -------------------- Linter & Documentation --------------------------------------------------------------------------


flake8-lint:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
160
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
161
162
163
164
  script:
    - flake8 lbmpy
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
165
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
166
167
168
169


build-documentation:
  stage: test
170
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
171
172
  script:
    - export PYTHONPATH=`pwd`
Martin Bauer's avatar
Martin Bauer committed
173
    - 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
174
    - mkdir html_doc
Markus Holzer's avatar
Markus Holzer committed
175
176
    - sphinx-build -b html doc html_doc
    - sphinx-build -W -b html doc html_doc
Martin Bauer's avatar
Martin Bauer committed
177
178
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
179
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
180
181
182
183
184
185
  artifacts:
    paths:
      - html_doc


pages:
186
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
187
188
189
190
191
192
193
194
195
196
197
198
  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