Commit eafb35c3 authored by Vincent Texier's avatar Vincent Texier
Browse files

[enh] add .gitlab-ci.yml

parent 52ca68a2
Pipeline #13705 failed with stages
in 36 seconds
stages:
- checks
- tests
- release
variables:
DOCKER_IMAGE: "registry.duniter.org/docker/python3/poetry"
PYTHON_VERSION: "3.7"
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
.code_changes:
rules:
- changes:
- tikka/**/*.py
- tests/**/*.py
.changes:
rules:
- changes:
- tikka/**/*.py
- tests/**/*.py
- .gitlab-ci.yml
- Makefile
- pyproject.toml
build:
extends: .changes
stage: checks
script:
- poetry build
.pre-commit:
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
paths:
- ${PRE_COMMIT_HOME}
format:
extends:
- .code_changes
- .pre-commit
stage: checks
script:
- pre-commit run --all-files black
isort:
extends:
- .code_changes
- .pre-commit
stage: checks
script:
- pre-commit run --all-files isort
lint:
extends:
- .code_changes
- .pre-commit
stage: checks
tags: [redshift]
script:
- pre-commit run --all-files pylint
type:
extends:
- .code_changes
- .pre-commit
stage: checks
script:
- pre-commit run --all-files mypy
.tests:
extends: .changes
stage: tests
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
script:
- poetry install --no-root
- bin/tests.sh domains
pypi:
stage: release
script:
- poetry publish --build --username $PYPI_LOGIN --password $PYPI_PASSWORD
rules:
- if: $CI_COMMIT_TAG
when: manual
- if: $CI_COMMIT_BRANCH == "main"
when: manual
- when: never
pypi_test:
stage: release
script:
- poetry config repositories.pypi_test https://test.pypi.org/legacy/
- poetry publish --build --username $PYPI_TEST_LOGIN --password $PYPI_TEST_PASSWORD --repository pypi_test
rules:
- if: $CI_COMMIT_TAG
when: manual
- if: $CI_COMMIT_BRANCH == "main"
when: manual
- when: never
ubuntu-18.04:
stage: release
image: "registry.duniter.org/docker/python3/tikka-builder/ubuntu-18.04"
script:
- poetry install
- make i18n_build
- make pyinstaller
# artifacts:
# paths:
# - dist/tikka.zip
# expire_in: 1 yrs
rules:
# - if: $CI_COMMIT_TAG
# when: manual
# - if: $CI_COMMIT_BRANCH == "main"
# when: manual
- when: manual
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment