.gitlab-ci.yml 3.59 KB
Newer Older
Martin Bauer's avatar
Martin Bauer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
  image: i10git.cs.fau.de:5005/software/pystencils/full
  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
Martin Bauer's avatar
Martin Bauer committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun"
  tags:
    - docker
    - cuda
    - AVX
  artifacts:
    when: always
    paths:
      - coverage_report

# Nightly test  - runs "long run" jobs only
test-longrun:
  stage: test
  only:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/software/pystencils/full
  script:
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
42
    - 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=.
  tags:
    - docker
    - cuda
    - 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
65
    - 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
66
67
68
69
70
71
72
73
74
75
    - python -c "import numpy"
    - python setup.py quicktest

minimal-ubuntu:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/software/pystencils/minimal_ubuntu
  script:
Martin Bauer's avatar
Martin Bauer committed
76
    - pip3 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
77
78
79
80
81
82
83
84
85
86
87
    - python3 setup.py quicktest
  tags:
    - docker

minimal-conda:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/software/pystencils/minimal_conda
  script:
Martin Bauer's avatar
Martin Bauer committed
88
    - 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    - python setup.py quicktest
  tags:
    - docker


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


flake8-lint:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/software/pystencils/full
  script:
    - flake8 lbmpy
  tags:
    - docker
    - cuda


build-documentation:
  stage: test
  image: i10git.cs.fau.de:5005/software/pystencils/full
  script:
    - export PYTHONPATH=`pwd`
Martin Bauer's avatar
Martin Bauer committed
115
    - 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
    - mkdir html_doc
    - sphinx-build -W -b html doc  html_doc
  tags:
    - docker
    - cuda
  artifacts:
    paths:
      - html_doc


pages:
  image: i10git.cs.fau.de:5005/software/pystencils/full
  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