Added unit tests in the CI
This commit is contained in:
parent
787e90907f
commit
ca0f596e37
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ tmp/
|
|||||||
build
|
build
|
||||||
htmlcov
|
htmlcov
|
||||||
dist
|
dist
|
||||||
|
.coverage
|
||||||
|
@ -1,13 +1,31 @@
|
|||||||
image: python:latest
|
image: python:latest
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- lint
|
||||||
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- pip install poetry
|
||||||
|
- poetry install --no-root
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
stage: test
|
stage: lint
|
||||||
before_script:
|
|
||||||
- pip install poetry
|
|
||||||
- poetry install --no-root
|
|
||||||
script:
|
script:
|
||||||
- poetry run ruff check ./src
|
- poetry run ruff check
|
||||||
- poetry run ruff format --check ./src
|
- poetry run ruff format --check
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- poetry run pytest --cov=. --cov-report=xml
|
||||||
|
after_script:
|
||||||
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
coverage_report:
|
||||||
|
coverage_format: cobertura
|
||||||
|
path: coverage.xml
|
||||||
|
|
||||||
deploy_to_pypi:
|
deploy_to_pypi:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
@ -16,8 +34,5 @@ deploy_to_pypi:
|
|||||||
- master
|
- master
|
||||||
changes:
|
changes:
|
||||||
- pyproject.toml
|
- pyproject.toml
|
||||||
before_script:
|
|
||||||
- pip install poetry
|
|
||||||
- poetry install --no-root
|
|
||||||
script:
|
script:
|
||||||
- POETRY_PYPI_TOKEN_PYPI=$PYPI_PASSWORD poetry publish --build
|
- POETRY_PYPI_TOKEN_PYPI=$PYPI_PASSWORD poetry publish --build
|
||||||
|
Loading…
x
Reference in New Issue
Block a user