diff --git a/.github/workflows/python_package_build.yml b/.github/workflows/python_package_build.yml new file mode 100644 index 0000000..b057f78 --- /dev/null +++ b/.github/workflows/python_package_build.yml @@ -0,0 +1,32 @@ +# This workflow will install dependencies, build Pyctuator, run tests (+coverage) and lint + +name: build + +on: + push: + pull_request: + +jobs: + run_image: + runs-on: [ubuntu-18.04] + container: + image: matanrubin/python-poetry:3.7 + + steps: + - uses: actions/checkout@v2 + - run: cd .. + - run: make bootstrap + - run: poetry update -vvv + - run: poetry build -vvv + - run: poetry install --extras flask --extras fastapi --extras db --extras redis + - run: make coverage + - uses: actions/upload-artifact@v2 + with: + name: htmlcov.zip + path: htmlcov/ + - uses: codecov/codecov-action@v1 + + # Install the extra psutil module and run linting+tests in the "psutil enabled" env + - run: poetry install --extras psutil + - run: make check + - run: make test diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ce0459d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,55 +0,0 @@ -variables: - DOCKER_DRIVER: overlay2 - -cache: - paths: - - .poetry-cache - -stages: - - build - - deploy - -build: - image: matanrubin/python-poetry:3.7 - stage: build - script: - # Instruct poetry to keep the .venv directory in the current working directory so gitlab would cache it - - poetry config virtualenvs.in-project true - - poetry config cache-dir .poetry-cache - - poetry config virtualenvs.path .poetry-cache/venv - - # Ask poetry to install all required modules (skipping the "dev" and "extra" modules) than build - - poetry install - - make package - - # Install the extra flask and fastapi modules required for the tests, then checkstyle and run the tests in "no psutil" env - - poetry install --extras flask --extras fastapi --extras db --extras redis - - make coverage - - # Install the extra psutil module and run the tests in "with psutil" env - - poetry install --extras psutil - - make test - - # Perform linting after all dependencies have been installed! - - make check - - artifacts: - paths: - - htmlcov - -deploy: - image: matanrubin/python-poetry:3.7 - stage: deploy - script: - # Instruct poetry to keep the .venv directory in the current working directory so gitlab would cache it - - poetry config virtualenvs.in-project true - - poetry config cache-dir .poetry-cache - - poetry config virtualenvs.path .poetry-cache/venv - - # Ask poetry to install all required modules (skipping the "dev" and "extra" modules) than build - - poetry build - - poetry config repositories.sedg-oss-pypi ${PYPI_REPO} - - poetry publish --repository sedg-oss-pypi --username ${PYPI_USER} --password ${PYPI_PASSWORD} - only: - - master - when: manual diff --git a/Makefile b/Makefile index 5ec0a21..e63f409 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ test: poetry run pytest --log-cli-level=4 --tb=no -v tests coverage: - poetry run pytest --cov-report html --cov-report term --cov=pyctuator --log-cli-level=4 --tb=no -v tests + poetry run pytest --cov-report xml:./cov.xml --cov-report html --cov-report term --cov=pyctuator --log-cli-level=4 --tb=no -v tests pylint: poetry run pylint --exit-zero pyctuator tests diff --git a/README.md b/README.md index 588589e..1ce5874 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ +![build](https://github.com/SolarEdgeTech/pyctuator/workflows/build/badge.svg) +![codecov](https://codecov.io/gh/SolarEdgeTech/pyctuator/branch/master/graph/badge.svg) + # Pyctuator -Pyctuator allows monitoring your Python microservice as if it were a Spring -Boot application using +Monitoring your Python microservices as if they were Spring +Boot applications using [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin). The supported web frameworks are **Flask** and **FastAPI**. diff --git a/pyproject.toml b/pyproject.toml index 741c8b2..6380dda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyctuator" -version = "0.1.1" +version = "0.9" description = "A Python implementation of the Spring Actuator API for popular web frameworks" authors = [ "Michael Yakobi ", @@ -46,7 +46,7 @@ redis = {version = "^3.3", optional = true} requests = "^2.22" pytest = "^3.0" mypy = "^0.730.0" -pylint = "^2.4" +pylint = "~2.4.4" # v2.5 does not properly run on docker image... pytest-cov = "^2.8" autopep8 = "^1.4"