From 2576afc09e12f51913fa4a8361181a6eaa5729ee Mon Sep 17 00:00:00 2001 From: Leander Karp <karp@cl.uni-heidelberg.de> Date: Wed, 4 Sep 2024 15:07:21 +0200 Subject: [PATCH] Update pipeline to check types and formatting --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4bee32..adb629a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,26 @@ # * Author: (c) 2011-present GitLab B.V. # * URL: https://docs.gitlab.com/ee/ci/docker/using_kaniko.html#building-a-docker-image-with-kaniko # * License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0) +stages: + - test + - build + +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + +testing: + image: python:latest + cache: + paths: + - .cache/pip + stage: test + before_script: + - pip install pipenv + - pipenv requirements --dev > requirements.txt + - pip install -r requirements.txt + script: + - black --check $CI_PROJECT_DIR + - mypy . docker-build: image: @@ -17,3 +37,4 @@ docker-build: - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG only: - master + needs: [testing] -- GitLab