.gitlab-ci.yml 1.52 KB
Newer Older
Wietse Kuipers's avatar
Wietse Kuipers committed
1 2 3 4
variables:
  POSTGRES_DB: thalia
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
5
  CI_DEPS: psycopg2-binary
6 7 8 9 10 11
  # 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
12 13
  PY35_IMAGE: thalia/python-thalia:3.5
  PY36_IMAGE: thalia/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 33
python35-django20:
  <<: *djangotest
34
  image: $PY35_IMAGE
Thom Wiggers's avatar
Thom Wiggers committed
35 36 37 38
  variables:
    PYTHON_VERSION: py35
    DJANGO_VERSION: django20

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

Thom Wiggers's avatar
Thom Wiggers committed
46
docs:
47
  image: $PY35_IMAGE
Thom Wiggers's avatar
Thom Wiggers committed
48 49 50
  before_script:
    # install django deps
    - pip install -r requirements.txt
51
    - pip install -r dev-requirements.txt
Thom Wiggers's avatar
Thom Wiggers committed
52 53 54 55
    - cd docs
    # install doc deps
    - pip install -r requirements.txt
  script:
Thom Wiggers's avatar
Thom Wiggers committed
56
    - echo "Building current docs"
Thom Wiggers's avatar
Thom Wiggers committed
57
    - env -u GITLAB_CI make doctest
Thom Wiggers's avatar
Thom Wiggers committed
58
    - env -u GITLAB_CI sphinx-build -M html "." "_build" -W -j $(nproc)
Thom Wiggers's avatar
Thom Wiggers committed
59 60 61
    - echo "Checking if there are changes"
    - ./generate-apidocs.sh
    - git diff --exit-code
Thom Wiggers's avatar
Thom Wiggers committed
62

Thom Wiggers's avatar
Thom Wiggers committed
63
cache:
64
  key: "$CI_JOB_NAME"
Thom Wiggers's avatar
Thom Wiggers committed
65
  paths:
Thom Wiggers's avatar
Thom Wiggers committed
66
    - "${PIP_CACHE_DIR}"
Thom Wiggers's avatar
Thom Wiggers committed
67 68

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