From 9032e2b58e0d8410131fe56b0e207fa4538adf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Sun, 13 Aug 2023 13:16:42 +0200 Subject: [PATCH] chore: Gitlab CI refactoring --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b9984e7..2895cd9d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,44 +9,60 @@ stages: before_script: - apt update - env DEBIAN_FRONTEND=noninteractive apt install --yes python3-dev libldap2-dev libsasl2-dev libssl-dev slapd ldap-utils - - curl -O https://bootstrap.pypa.io/get-pip.py - - python get-pip.py - - pip install --upgrade tox "poetry>1.3.0" coveralls pyyaml tomli + - poetry config virtualenvs.in-project true + +cache: + paths: + - .venv style: image: python:3.11 stage: test - script: tox -e style + script: + - pip install pre-commit + - pre-commit run --all-files --show-diff-on-failure python38: image: python:3.8 stage: test - script: tox -e py38 + script: + - poetry install + - poetry run pytest python39: image: python:3.9 stage: test - script: tox -e py39 + script: + - poetry install + - poetry run pytest python310: image: python:3.10 stage: test - script: tox -e py310 + script: + - poetry install + - poetry run pytest python311: image: python:3.11 stage: test - script: tox -e py311 + script: + - poetry install + - poetry run pytest doc: image: python:3.11 stage: test - script: tox -e doc + script: + - poetry install --only doc + - poetry run sphinx-build doc build/sphinx/html coverage: image: python:3.11 stage: test allow_failure: true script: - - tox -e coverage + - pip install coveralls pyyaml tomli + - poetry install + - poetry run pytest --cov --cov-fail-under=100 --cov-report term:skip-covered -n auto - coveralls