.gitlab-ci.yml 4.87 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
    - env
17
    - 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
22
    - 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
23 24
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
25
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
26 27 28 29 30
    - AVX
  artifacts:
    when: always
    paths:
      - coverage_report
31
      - test-report
Martin Bauer's avatar
Martin Bauer committed
32 33 34 35 36 37 38

# 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
44
    - 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
45 46
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
47
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
48 49 50 51
    - AVX
  artifacts:
    paths:
      - coverage_report
52
      - test-report
Martin Bauer's avatar
Martin Bauer committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

# 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

70
ubuntu:
Martin Bauer's avatar
Martin Bauer committed
71 72 73 74
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
75
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
Martin Bauer's avatar
Martin Bauer committed
76
  script:
77 78
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Michael Kuron's avatar
Michael Kuron committed
79
    - sed -i 's/--doctest-modules //g' pytest.ini
80
    - pytest-3 -v -m "not longrun"
Martin Bauer's avatar
Martin Bauer committed
81 82
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
83
    - cuda11
Stephan Seitz's avatar
Stephan Seitz committed
84
    - AVX
Martin Bauer's avatar
Martin Bauer committed
85 86 87 88 89 90

minimal-conda:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
91
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/minimal_conda
Martin Bauer's avatar
Martin Bauer committed
92 93 94 95
  script:
    - python setup.py quicktest
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
96
    - cuda
Martin Bauer's avatar
Martin Bauer committed
97 98


Stephan Seitz's avatar
Stephan Seitz committed
99 100 101 102 103 104 105 106 107 108 109 110
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
Markus Holzer's avatar
Markus Holzer committed
111
    - cuda
Stephan Seitz's avatar
Stephan Seitz committed
112

113 114 115 116 117

pycodegen-integration:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  stage: test
  when: manual
Markus Holzer's avatar
Markus Holzer committed
118
  allow_failure: true
119 120 121 122 123 124 125 126
  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
127 128
    - git remote add test $CI_REPOSITORY_URL
    - git fetch test
129 130
    - git reset --hard $CI_COMMIT_SHA
    - cd ..
Markus Holzer's avatar
Markus Holzer committed
131 132 133
    - pip install -e pystencils/
    - pip install -e lbmpy/
    - pip install -e pygrandchem/
134 135 136 137 138 139 140 141 142 143 144
    - ./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/
145
    - make CodegenJacobiCPU CodegenJacobiGPU CodegenPoissonCPU CodegenPoissonGPU MicroBenchmarkGpuLbm LbCodeGenerationExample UniformGridBenchmarkGPU_trt UniformGridBenchmarkGPU_entropic_kbc_n4 FluctuatingMRT
Markus Holzer's avatar
Markus Holzer committed
146 147 148 149
    - cd apps/benchmarks/UniformGridGPU
    - make -j $NUM_CORES
    - cd ../UniformGridGenerated
    - make -j $NUM_CORES
150 151
  tags:
    - docker
Markus Holzer's avatar
Markus Holzer committed
152
    - cuda11
153 154
    - AVX

Martin Bauer's avatar
Martin Bauer committed
155 156 157 158 159 160 161 162
# -------------------- Linter & Documentation --------------------------------------------------------------------------


flake8-lint:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
163
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
164 165 166 167 168 169 170 171
  script:
    - flake8 pystencils
  tags:
    - docker


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


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