Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.03 KiB
image: registry.edugit.org/teckids/team-sysadmin/docker-images/python-pimped:master

stages:
  - test
  - build
  - deploy

variables:
  GIT_SUBMODULE_STRATEGY: recursive
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  FF_NETWORK_PER_BUILD: "true"

cache:
  key:
    files:
      - poetry.lock
      - pyproject.toml
  paths:
    - .cache/pip
    - .tox

test:
  stage: test
  services:
    - name: selenium/standalone-firefox
      alias: selenium
  before_script:
    - adduser --disabled-password --gecos "Test User" testuser
    - chown -R testuser .
  script:
    - sudo apt update
    - sudo apt install python3-ldap libldap2-dev libssl-dev libsasl2-dev python3.7-dev -y
    - sudo -u testuser
      env TEST_SELENIUM_HUB=http://selenium:4444/wd/hub
          TEST_SELENIUM_BROWSERS=firefox
          TEST_HOST=build
      tox -e selenium -- --junitxml=.tox/junit.xml
  artifacts:
    paths:
      - .tox/screenshots
    reports:
      junit: .tox/junit.xml

lint:
  stage: test
  script:
    - tox -e lint,security
  allow_failure: true

build_dist:
  stage: build
  script:
    - tox -e build
  artifacts:
    paths:
      - dist/

pages:
  stage: deploy
  before_script:
    - cp -r .tox/screenshots/firefox docs/screenshots
  script:
    - export LC_ALL=en_GB.utf8
    - tox -e docs -- BUILDDIR=../public/docs
  artifacts:
    paths:
    - public/
  only:
    - master