Skip to content

Commit 25cd019

Browse files
committed
Add github action: python package build
New action uses a dedicated docker container with Poetry. It installs dependencies, builds the package, runs tests, coverage and lint. Add badges to README.md: build and codecod. Remove .gitlab-ci.yml
1 parent 9ba98d6 commit 25cd019

File tree

5 files changed

+40
-60
lines changed

5 files changed

+40
-60
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow will install dependencies, build Pyctuator, run tests (+coverage) and lint
2+
3+
name: build
4+
5+
on:
6+
push:
7+
pull_request:
8+
9+
jobs:
10+
run_image:
11+
runs-on: [ubuntu-18.04]
12+
container:
13+
image: matanrubin/python-poetry:3.7
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- run: cd ..
18+
- run: make bootstrap
19+
- run: poetry update -vvv
20+
- run: poetry build -vvv
21+
- run: poetry install --extras flask --extras fastapi --extras db --extras redis
22+
- run: make coverage
23+
- uses: actions/upload-artifact@v2
24+
with:
25+
name: htmlcov.zip
26+
path: htmlcov/
27+
- uses: codecov/codecov-action@v1
28+
29+
# Install the extra psutil module and run linting+tests in the "psutil enabled" env
30+
- run: poetry install --extras psutil
31+
- run: make check
32+
- run: make test

.gitlab-ci.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test:
1919
poetry run pytest --log-cli-level=4 --tb=no -v tests
2020

2121
coverage:
22-
poetry run pytest --cov-report html --cov-report term --cov=pyctuator --log-cli-level=4 --tb=no -v tests
22+
poetry run pytest --cov-report xml:./cov.xml --cov-report html --cov-report term --cov=pyctuator --log-cli-level=4 --tb=no -v tests
2323

2424
pylint:
2525
poetry run pylint --exit-zero pyctuator tests

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
![build](https://github.com/SolarEdgeTech/pyctuator/workflows/build/badge.svg)
2+
![codecov](https://codecov.io/gh/SolarEdgeTech/pyctuator/branch/master/graph/badge.svg)
3+
14
# Pyctuator
25

3-
Pyctuator allows monitoring your Python microservice as if it were a Spring
4-
Boot application using
6+
Monitoring your Python microservices as if they were Spring
7+
Boot applications using
58
[Spring Boot Admin](https://github.com/codecentric/spring-boot-admin).
69

710
The supported web frameworks are **Flask** and **FastAPI**.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyctuator"
3-
version = "0.1.1"
3+
version = "0.9"
44
description = "A Python implementation of the Spring Actuator API for popular web frameworks"
55
authors = [
66
"Michael Yakobi <[email protected]>",
@@ -46,7 +46,7 @@ redis = {version = "^3.3", optional = true}
4646
requests = "^2.22"
4747
pytest = "^3.0"
4848
mypy = "^0.730.0"
49-
pylint = "^2.4"
49+
pylint = "~2.4.4" # v2.5 does not properly run on docker image...
5050
pytest-cov = "^2.8"
5151
autopep8 = "^1.4"
5252

0 commit comments

Comments
 (0)