Skip to content
Snippets Groups Projects

#118: Set up complete CI/CD pipeline

Merged Moul requested to merge 118_enh_ci into dev
Compare and
1 file
+ 55
24
Compare changes
  • Side-by-side
  • Inline
+ 55
24
stages:
stages:
- format
- checks
- test
- tests
- build
- release
- release
- publish_doc
- publish_doc
variables:
variables:
DOCKER_IMAGE: "registry.duniter.org/docker/python3/poetry"
DOCKER_IMAGE: "registry.duniter.org/docker/python3/poetry"
PYTHON_VERSION: "3.5"
PYTHON_VERSION: "3.8"
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
# SUB-TASKS
.push_to_github:
.push_to_github:
tags:
tags:
- github
- github
@@ -31,47 +29,81 @@ image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
@@ -31,47 +29,81 @@ image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
# github push
# github push
- bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
- bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
 
.code_changes:
 
only:
 
changes:
 
- duniterpy/**/*.py
 
- tests/**/*.py
 
- examples/*.py
 
.changes:
.changes:
only:
only:
changes:
changes:
- duniterpy/**/*.py
- duniterpy/**/*.py
 
- tests/**/*.py
 
- examples/*.py
- .gitlab-ci.yml
- .gitlab-ci.yml
- Makefile
- Makefile
- tests/**/*.py
- pyproject.toml
- pyproject.toml
# TASKS
format:
format:
extends:
extends:
- .changes
- .code_changes
stage: format
stage: checks
image: $DOCKER_IMAGE/3.8:latest
script:
script:
- make check-format
- make check-format
test:
build:
extends:
extends:
- .changes
- .changes
stage: test
stage: checks
script:
script:
- poetry install --no-dev
- poetry build
- make tests
check:
type:
extends:
extends:
- .changes
- .code_changes
stage: test
stage: checks
script:
script:
- poetry install
- make mypy
- make mypy
- make pylint
build:
lint:
extends:
extends:
- .changes
- .code_changes
stage: build
stage: checks
script:
script:
- poetry build
- poetry install
 
- make pylint
 
 
.tests:
 
extends: .changes
 
stage: tests
 
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
 
script:
 
- poetry install --no-dev
 
- make tests
 
 
tests-3.5:
 
extends: .tests
 
tags: [poetry-56]
 
variables:
 
PYTHON_VERSION: "3.5"
 
 
tests-3.6:
 
extends: .tests
 
tags: [poetry-56]
 
variables:
 
PYTHON_VERSION: "3.6"
 
 
tests-3.7:
 
extends: .tests
 
tags: [poetry-78]
 
variables:
 
PYTHON_VERSION: "3.7"
 
 
tests-3.8:
 
extends: .tests
 
tags: [poetry-78]
release:
release:
extends:
extends:
@@ -99,7 +131,6 @@ pages:
@@ -99,7 +131,6 @@ pages:
- tags
- tags
- master
- master
script:
script:
- poetry install
- make docs
- make docs
- mv docs/_build/html public
- mv docs/_build/html public
- ls public
- ls public
Loading