Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.44 KiB
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/python:3.6

# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
  paths:
    - .cache/pip
    - venv/

before_script:
  - pip install virtualenv
  - make show-version # Print out python version for debugging
  - virtualenv venv
  - source venv/bin/activate
  - make deps

stages:          # List of stages for jobs, and their order of execution
  - test
  - check-warnings
  - build
  - deploy

unit-test-job:  
  stage: test
  script:
    - make test 2>&1 | tee errors.log
  artifacts:
    when: always
    paths:
      - errors.log
    reports:
      junit: nose2-junit.xml

pylint-test-job:
  stage: test
  script:
    - make pylint

pyflakes-test-job:
  stage: test
  script:
    - make pyflakes

check-deprecation-warnings:
  before_script: []
  stage: check-warnings
  script:
    - "if [[ $(grep DeprecationWarning errors.log) ]]; then cat errors.log; exit 1; fi"
  allow_failure: true

build-job:
  stage: build
  script:
    - make buildbot
    - git clone https://gitlab-ci-token:$SIGNER_TOKEN@$SIGNER_REPO
    - bash signer/init_keyring.sh
    - python signer/signer.py --verbose $GPG_KEY "$PWD/dist"
  artifacts:
    paths:
      - dist