From 96475ee86512c0861b764291f18fa454307425ee Mon Sep 17 00:00:00 2001 From: Radu Marinoiu Date: Tue, 18 Jan 2022 12:27:08 +0200 Subject: [PATCH] Added gitlab-ci config --- .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d1d70b5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +include: + - template: Code-Quality.gitlab-ci.yml + +image: + python:3.10-bullseye + +stages: + - test + +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + +unit-test-job: + stage: test + before_script: + - python3 -m pip install --upgrade -r requirements.txt + - python3 -m pip install --upgrade -r requirements_ci.txt + script: + - echo "Running unit tests..." + - coverage run --source=tap_mambu/tap_mambu_refactor -m pytest tests/refactor_unittests + - coverage json + - python3 -c "import json; coverage_json = json.loads(open('coverage.json', 'r').read()); print('Coverage is', round(coverage_json['totals']['percent_covered'], 2))" + +lint-test-job: + stage: test + before_script: + - python3 -m pip install --upgrade -r requirements.txt + - python3 -m pip install --upgrade -r requirements_ci.txt + script: + - echo "Linting code..." + - pylint tap_mambu/tap_mambu_refactor --exit-zero + - pylint tap_mambu/tap_mambu_refactor -d C -d R -d W || true