cycles/.gitlab-ci.yml
2022-04-15 19:10:51 +00:00

44 lines
1.1 KiB
YAML

stages:
- build
- test
build:
stage: build
image: python:3-buster
script:
- export PYTHONPATH=.
- export FLASK_APP=period
- apt-get update -qy
- apt-get install -y python3-dev python3-pip
- pip3 install --upgrade pip
- pip3 install --upgrade setuptools
- pip3 install Flask gunicorn pytest pytest-cov
- pip3 install pendulum
- echo "DOCKER_IMAGE_NAME_TAG_WITH_DIGEST=${DOCKER_IMAGE_TAG_REF}@$(cat /digest-file)" > out.env
- cat out.env
artifacts:
reports:
dotenv: out.env
test:
stage: test
needs: [build]
image: ${DOCKER_IMAGE_NAME_TAG_WITH_DIGEST}
before_script:
- echo "${DOCKER_IMAGE_NAME_TAG_WITH_DIGEST}"
script:
- export PYTHONPATH=.
- export FLASK_APP=period
- apt-get update -qy
- apt-get install -y python3-dev python3-pip
- pip3 install --upgrade pip
- pip3 install --upgrade setuptools
- pip3 install Flask gunicorn pytest pytest-cov
- pip3 install pendulum
- pytest tests --cov --cov-report term --cov-report html --junitxml=report.xml
artifacts:
when: always
reports:
juint: report.xml