Commit 5be7e5f0 authored by Stewart Williams's avatar Stewart Williams
Browse files

Run code analysis on 'make test'

Gitlab CI fixes

Gitlab CI fixes
parent 35b30933
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -3,6 +3,10 @@
# In this case we use the latest python docker image to build and test this project.
image: registry.gitlab.com/ska-telescope/ska-docker/tango-builder:latest

variables:
  DOCKER_HOST: tcp://docker:2375
  DOCKER_DRIVER: overlay

services:
- docker:dind

@@ -13,19 +17,23 @@ cache:
    
# before_script is used to define the command that should be run before all jobs, including deploy jobs, but after the restoration of artifacts. 
# This can be an array or a multi-line string.
before_script:
  - python -V  # Print out python version for debugging
#before_script:
#  - python -V  # Print out python version for debugging

# The YAML file defines a set of jobs with constraints stating when they should be run.
# You can specify an unlimited number of jobs which are defined as top-level elements with an arbitrary name and always have to contain at least the script clause.
# In this case we have only the test job which produce an artifacts (it must be placed into a directory called "public")
# It is also specified that only the master branch will be subject of this job.
test:

build:          
  script:
  - make build
  - make push

test:
  script:
  - make test
  - mv build/* .public
  - mv .public public
  - mv build public
  artifacts:
    paths:
    - public
@@ -33,3 +41,4 @@ test:
code_analysis:
  script:
    - pipenv run bash code-analysis.sh
+1 −1
Original line number Diff line number Diff line
DOCKER_REGISTRY_USER=ska-telescope
PROJECT = ska-skeleton
include .make/Makefile.mk

PROJECT = ska-skeleton

# name of the Docker volume used to cache eggs and wheels
CACHE_VOLUME = $(PROJECT)-test-cache
+4 −2
Original line number Diff line number Diff line
all: test

test:
	cd /app && python setup.py test | tee test_output.log
	cd /app && python setup.py test | tee setup_py_test.stdout
	cd /app && ./code-analysis.sh | tee code_analysis.stdout
	# A temporary volume is mounted at /build when 'make test' is executing.
	# The following steps copy across useful output to this volume which can
	# then be extracted to form the CI summary for the test procedure.
	if [ -d /build ]; then \
		mv /app/test_output.log /build; \
		mv /app/setup_py_test.stdout /build; \
		mv /app/code_analysis.stdout /build; \
		mv /app/htmlcov /build; \
		mv /app/coverage.xml /build; \
	fi;