-
Thomas Juerges authoredThomas Juerges authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 2.96 KiB
# TODO(Corne): Update this image to use our own registry once building
# images is in place.
image: artefact.skao.int/ska-tango-images-tango-itango:9.3.7
variables:
GIT_SUBMODULE_STRATEGY: recursive
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
stages:
- building
- linting
- static-analysis
- unit-tests
- integration-tests
- packaging
newline_at_eof:
stage: linting
before_script:
- pip3 install -r tangostationcontrol/test-requirements.txt
script:
# TODO(Corne): Ignore shell files in submodules more cleanly
- flake8 --filename *.sh,*.conf,*.md,*.yml --select=W292 --exclude docker-compose/tango-prometheus-exporter,.tox,.egg-info,docker
python_linting:
stage: linting
before_script:
- sudo apt-get update
- sudo apt-get install -y git
script:
- cd tangostationcontrol
- tox -e pep8
bandit:
stage: static-analysis
before_script:
- sudo apt-get update
- sudo apt-get install -y git
script:
- cd tangostationcontrol
- tox -e bandit
shellcheck:
stage: static-analysis
before_script:
- sudo apt-get update
- sudo apt-get install -y shellcheck
script:
# TODO(Corne): Ignore shell files in submodules
- shellcheck **/*.sh
unit_test:
stage: unit-tests
before_script:
- sudo apt-get update
- sudo apt-get install -y git
script:
- cd tangostationcontrol
- tox -e py37
integration_test_docker:
stage: integration-tests
image: docker:latest
tags:
- privileged
services:
- name: docker:dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- apk add --update make bash docker-compose
- apk add --update bind-tools
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- touch /root/.Xauthority