.gitlab-ci.yml 1.58 KB
Newer Older
Wietse Kuipers's avatar
Wietse Kuipers committed
1
2
3
4
5
variables:
  POSTGRES_DB: thalia
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  CI_DEPS: psycopg2
6
7
8
9
10
11
12
  # https://hub.docker.com/r/twiggers/python-thalia/
  # https://github.com/thomwiggers/python-thalia
  # Should get auto-updated with the official 'python' repository
  # Installs:
  #  - pip: tox, coverage
  #  - apt: ghostscript
  PY35_IMAGE: twiggers/python-thalia:3.5
13
  PY36_IMAGE: twiggers/python-thalia:3.6
Thom Wiggers's avatar
Thom Wiggers committed
14
  PIP_CACHE_DIR: "${CI_PROJECT_DIR}/pip-cache"
Wietse Kuipers's avatar
Wietse Kuipers committed
15

Thom Wiggers's avatar
Thom Wiggers committed
16
pep8:
17
  image: $PY35_IMAGE
Thom Wiggers's avatar
Thom Wiggers committed
18
19
20
21
22
  before_script:
  script:
    - tox -e flake8

.djangotest: &djangotest
Thom Wiggers's avatar
Thom Wiggers committed
23
24
  services:
    - postgres:latest
Thom Wiggers's avatar
Thom Wiggers committed
25
26
27
  before_script:
    - git log -1
  script:
Thom Wiggers's avatar
Thom Wiggers committed
28
    - tox -e ${PYTHON_VERSION}-${DJANGO_VERSION}
Thom Wiggers's avatar
Thom Wiggers committed
29
30
    - cd website
    - coverage report
Thom Wiggers's avatar
Thom Wiggers committed
31

Thom Wiggers's avatar
Thom Wiggers committed
32
python35-django11:
Thom Wiggers's avatar
Thom Wiggers committed
33
  <<: *djangotest
34
  image: $PY35_IMAGE
Thom Wiggers's avatar
Thom Wiggers committed
35
36
  variables:
    PYTHON_VERSION: py35
Thom Wiggers's avatar
Thom Wiggers committed
37
38
    DJANGO_VERSION: django11

Thom Wiggers's avatar
Thom Wiggers committed
39
40
python35-django20:
  <<: *djangotest
41
  image: $PY35_IMAGE
Thom Wiggers's avatar
Thom Wiggers committed
42
43
44
45
  variables:
    PYTHON_VERSION: py35
    DJANGO_VERSION: django20

Thom Wiggers's avatar
Thom Wiggers committed
46
47
python36-django20:
  <<: *djangotest
48
  image: $PY36_IMAGE
Thom Wiggers's avatar
Thom Wiggers committed
49
50
51
52
  variables:
    PYTHON_VERSION: py36
    DJANGO_VERSION: django20

Thom Wiggers's avatar
Thom Wiggers committed
53
docs:
54
  image: $PY35_IMAGE
Thom Wiggers's avatar
Thom Wiggers committed
55
56
57
58
59
60
61
  before_script:
    # install django deps
    - pip install -r requirements.txt
    - cd docs
    # install doc deps
    - pip install -r requirements.txt
  script:
Thom Wiggers's avatar
Thom Wiggers committed
62
    - echo "Building current docs"
Thom Wiggers's avatar
Thom Wiggers committed
63
    - env -u GITLAB_CI make doctest
Thom Wiggers's avatar
Thom Wiggers committed
64
    - env -u GITLAB_CI sphinx-build -M html "." "_build" -W
Thom Wiggers's avatar
Thom Wiggers committed
65
66
67
    - echo "Checking if there are changes"
    - ./generate-apidocs.sh
    - git diff --exit-code
Thom Wiggers's avatar
Thom Wiggers committed
68

Thom Wiggers's avatar
Thom Wiggers committed
69
cache:
70
  key: "$CI_JOB_NAME"
Thom Wiggers's avatar
Thom Wiggers committed
71
  paths:
Thom Wiggers's avatar
Thom Wiggers committed
72
    - "${PIP_CACHE_DIR}"
Thom Wiggers's avatar
Thom Wiggers committed
73
74

# vim: set sw=2 ts=2 et :