.gitlab-ci.yml 1.78 KB
Newer Older
Thom Wiggers's avatar
Thom Wiggers committed
1 2 3 4 5
stages:
  - initial_testing
  - django11
  - docs

Wietse Kuipers's avatar
Wietse Kuipers committed
6 7 8 9 10 11
variables:
  POSTGRES_DB: thalia
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  CI_DEPS: psycopg2

Thom Wiggers's avatar
Thom Wiggers committed
12
pep8:
Thom Wiggers's avatar
Thom Wiggers committed
13
  stage: initial_testing
Thom Wiggers's avatar
Thom Wiggers committed
14 15 16 17 18 19 20 21
  image: python:3.4
  before_script:
    - export PIP_CACHE_DIR="pip-cache"
    - pip install tox
  script:
    - tox -e flake8

.djangotest: &djangotest
Thom Wiggers's avatar
Thom Wiggers committed
22 23
  services:
    - postgres:latest
Thom Wiggers's avatar
Thom Wiggers committed
24 25 26 27
  before_script:
    - export PIP_CACHE_DIR="pip-cache"
    - mkdir -p pip-cache
    - git log -1
Thom Wiggers's avatar
Thom Wiggers committed
28
    - pip install tox coverage
29 30
    - apt-get update
    - apt-get install -y ghostscript  # required for Thabloid's tests
Thom Wiggers's avatar
Thom Wiggers committed
31
  script:
Thom Wiggers's avatar
Thom Wiggers committed
32
    - tox -e ${PYTHON_VERSION}-${DJANGO_VERSION}
Thom Wiggers's avatar
Thom Wiggers committed
33 34
    - cd website
    - coverage report
Thom Wiggers's avatar
Thom Wiggers committed
35

Thom Wiggers's avatar
Thom Wiggers committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
python34-django10:
  <<: *djangotest
  stage: initial_testing
  image: python:3.4
  variables:
    PYTHON_VERSION: py34
    DJANGO_VERSION: django10

python35-django10:
  <<: *djangotest
  image: python:3.5
  stage: initial_testing
  variables:
    PYTHON_VERSION: py35
    DJANGO_VERSION: django10

python34-django11:
Thom Wiggers's avatar
Thom Wiggers committed
53
  <<: *djangotest
Thom Wiggers's avatar
Thom Wiggers committed
54
  stage: django11
Thom Wiggers's avatar
Thom Wiggers committed
55 56 57
  image: python:3.4
  variables:
    PYTHON_VERSION: py34
Thom Wiggers's avatar
Thom Wiggers committed
58
    DJANGO_VERSION: django11
Thom Wiggers's avatar
Thom Wiggers committed
59

Thom Wiggers's avatar
Thom Wiggers committed
60
python35-django11:
Thom Wiggers's avatar
Thom Wiggers committed
61
  <<: *djangotest
Thom Wiggers's avatar
Thom Wiggers committed
62
  stage: django11
Thom Wiggers's avatar
Thom Wiggers committed
63 64 65
  image: python:3.5
  variables:
    PYTHON_VERSION: py35
Thom Wiggers's avatar
Thom Wiggers committed
66 67 68 69 70 71 72 73 74
    DJANGO_VERSION: django11

python36-django11:
  <<: *djangotest
  stage: django11
  image: python:3.6
  variables:
    PYTHON_VERSION: py36
    DJANGO_VERSION: django11
Thom Wiggers's avatar
Thom Wiggers committed
75

Thom Wiggers's avatar
Thom Wiggers committed
76
docs:
Thom Wiggers's avatar
Thom Wiggers committed
77
  stage: docs
Thom Wiggers's avatar
Thom Wiggers committed
78 79 80 81 82 83 84 85
  image: python:3.5
  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
86
    - env -u GITLAB_CI make doctest
Thom Wiggers's avatar
Thom Wiggers committed
87 88
    - test -z "$(env -u GITLAB_CI make html | egrep -w 'SEVERE:|ERROR:')"

Thom Wiggers's avatar
Thom Wiggers committed
89
cache:
Thom Wiggers's avatar
Thom Wiggers committed
90
  key: "$CI_BUILD_NAME"
Thom Wiggers's avatar
Thom Wiggers committed
91 92 93 94
  paths:
    - pip-cache

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