diff --git a/.github/workflows/python_package_build.yml b/.github/workflows/python_package_build.yml new file mode 100644 index 0000000..f615cd1 --- /dev/null +++ b/.github/workflows/python_package_build.yml @@ -0,0 +1,43 @@ +# 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: make package + - 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/ + # - run: poetry run pytest --cov=./ --cov-report xml:./cov.xml + - run: ls -la + - uses: codecov/codecov-action@v1 + #with: + #token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + #file: ./coverage.xml # optional + #flags: unittests # optional + #name: codecov-umbrella # optional + #fail_ci_if_error: true # optional (default = false) - uses: actions/upload-artifact@v2 + + # Install the extra psutil module and run the tests in "with psutil" env + - run: poetry install --extras psutil + - run: make test + + # Perform linting after all dependencies have been installed! + - run: make check 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..d42e224 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ +![build](https://github.com/yanoom/pyctuator/workflows/build/badge.svg) +![codecov](https://codecov.io/gh/yanoom/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..8595cb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"