.gitlab-ci.yml 4.76 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
16
17
18
19
  script:
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - mkdir public
Martin Bauer's avatar
Martin Bauer committed
20
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
21
22
    - env
    - pip list
Martin Bauer's avatar
Martin Bauer committed
23
24
25
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun"
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
26
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
27
28
29
30
31
32
33
34
35
36
37
38
    - AVX
  artifacts:
    when: always
    paths:
      - coverage_report

# Nightly test  - runs "long run" jobs only
test-longrun:
  stage: test
  only:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
39
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
40
41
42
43
  script:
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
44
    - 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
45
46
47
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=.
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
48
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    - AVX
  artifacts:
    paths:
      - coverage_report

# 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
67
    - 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
68
69
70
    - python -c "import numpy"
    - python setup.py quicktest

71
ubuntu:
Martin Bauer's avatar
Martin Bauer committed
72
73
74
75
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
76
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
Martin Bauer's avatar
Martin Bauer committed
77
  script:
78
79
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
80
    - pip3 install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
81
82
    - env
    - pip3 list
83
    - pytest-3 -v -m "not longrun"
Martin Bauer's avatar
Martin Bauer committed
84
85
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
86
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
87
88
89
90
91
92

minimal-conda:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
93
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/minimal_conda
Martin Bauer's avatar
Martin Bauer committed
94
  script:
Martin Bauer's avatar
Martin Bauer committed
95
    - 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
96
97
98
99
    - python setup.py quicktest
  tags:
    - docker

100
101
102
103
pycodegen-integration:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  stage: test
  when: manual
Markus Holzer's avatar
Markus Holzer committed
104
  allow_failure: true
105
106
107
108
109
110
111
  script:
    - 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
112
113
114
115
116
117
118
    - 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/
119
    - ./install_walberla.sh
Frederik Hennig's avatar
Frederik Hennig committed
120
121
122
    # build all integration tests
    - cd walberla/build/
    - make -j $NUM_CORES MicroBenchmarkGpuLbm LbCodeGenerationExample
123
124
125
126
    - cd apps/benchmarks/UniformGridGPU
    - make -j $NUM_CORES
    - cd ../UniformGridGenerated
    - make -j $NUM_CORES
Markus Holzer's avatar
Markus Holzer committed
127

128
129
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
130
    - cuda11
131
    - AVX
Martin Bauer's avatar
Martin Bauer committed
132
133
134
135
136
137
138
139
140

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


flake8-lint:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
141
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
142
143
144
145
  script:
    - flake8 lbmpy
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
146
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
147
148
149
150


build-documentation:
  stage: test
151
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
152
153
  script:
    - export PYTHONPATH=`pwd`
Martin Bauer's avatar
Martin Bauer committed
154
    - 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
155
    - mkdir html_doc
Markus Holzer's avatar
Markus Holzer committed
156
157
    - sphinx-build -b html doc html_doc
    - sphinx-build -W -b html doc html_doc
Martin Bauer's avatar
Martin Bauer committed
158
159
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
160
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
161
162
163
164
165
166
  artifacts:
    paths:
      - html_doc


pages:
167
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
168
169
170
171
172
173
174
175
176
177
178
179
  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