From 937d164e8a9ba4ca2dfdc4f313cf3747adcf0af8 Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Tue, 11 Jun 2019 22:17:05 +0200 Subject: [PATCH] [enh] #149: Add CI/CD .gitlab-ci.yml --- .gitlab-ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..ca813f54 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,57 @@ +stages: + - build + - checks + - tests + - publish + +image: hub.docker.com/r/nikaro/poetry + +.changes: &changes + only: + changes: + - .gitlab-ci.yml + - pyproject.toml + - poetry.lock + - bin/silkaj + - silkaj/*.py + - tests/*.py + +build: + <<: *changes + stage: build + script: + - poetry install + - poetry build + +format: + <<: *changes + stage: checks + script: + - poetry install + - poetry shell + - black --check bin silkaj tests + +type: + <<: *changes + stage: checks + script: + - poetry install + - poetry shell + - mypy/pyright + +tests: + <<: *changes + stage: tests + script: + - poetry install + - poetry shell + - pytest + - coverage run --source=duniterpy setup.py test + +publish: + stage: publish + tags: + when: manual + script: + - poetry install + - poetry publish --build --username duniter --password $PYPI_PASSWORD -- GitLab