.gitlab-ci.yml 4.55 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
20
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --html test-report/index.html
Martin Bauer's avatar
Martin Bauer committed
21
22
23
24
25
26
27
28
  tags:
    - docker
    - cuda
    - AVX
  artifacts:
    when: always
    paths:
      - coverage_report
29
      - test-report
Martin Bauer's avatar
Martin Bauer committed
30
31
32
33
34
35
36

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

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

68
ubuntu:
Martin Bauer's avatar
Martin Bauer committed
69
70
71
72
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
73
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
Martin Bauer's avatar
Martin Bauer committed
74
  script:
75
76
77
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - pytest-3 -v -m "not longrun"
Martin Bauer's avatar
Martin Bauer committed
78
79
  tags:
    - docker
80
    - cuda
Martin Bauer's avatar
Martin Bauer committed
81
82
83
84
85
86

minimal-conda:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
87
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/minimal_conda
Martin Bauer's avatar
Martin Bauer committed
88
89
90
91
92
93
  script:
    - python setup.py quicktest
  tags:
    - docker


Stephan Seitz's avatar
Stephan Seitz committed
94
95
96
97
98
99
100
101
102
103
104
105
106
minimal-sympy-master:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/minimal_conda
  script:
    - python -m pip install --upgrade git+https://github.com/sympy/sympy.git
    - python setup.py quicktest
  allow_failure: true
  tags:
    - docker

107
108
109
110
111
112
113
114
115
116
117
118
119

pycodegen-integration:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  stage: test
  when: manual
  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
    - cd pystencils
Stephan Seitz's avatar
Stephan Seitz committed
120
121
    - git remote add test $CI_REPOSITORY_URL
    - git fetch test
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
    - git reset --hard $CI_COMMIT_SHA
    - cd ..
    - export PYTHONPATH=`pwd`/pystencils:`pwd`/lbmpy:`pwd`/pygrandchem:`pwd`/pystencils_walberla:`pwd`/lbmpy_walberla
    - ./install_walberla.sh
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - cd pystencils
    - py.test -v -n $NUM_CORES .
    - cd ../lbmpy
    - py.test -v -n $NUM_CORES .
    - cd ../pygrandchem
    - py.test -v -n $NUM_CORES .
    - cd ../walberla/build/
    - make CodegenJacobiCPU CodegenJacobiGPU MicroBenchmarkGpuLbm LbCodeGenerationExample
  tags:
    - docker
    - cuda
    - AVX

Martin Bauer's avatar
Martin Bauer committed
142
143
144
145
146
147
148
149
# -------------------- Linter & Documentation --------------------------------------------------------------------------


flake8-lint:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
150
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
151
152
153
154
155
156
157
158
159
  script:
    - flake8 pystencils
  tags:
    - docker
    - cuda


build-documentation:
  stage: test
160
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
161
162
163
164
165
166
167
168
169
170
171
172
173
  script:
    - export PYTHONPATH=`pwd`
    - mkdir html_doc
    - sphinx-build -W -b html doc  html_doc
  tags:
    - docker
    - cuda
  artifacts:
    paths:
      - html_doc


pages:
174
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
175
176
177
178
179
180
181
182
183
184
185
  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:
186
    - master@pycodegen/pystencils