ci.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: kafkaesk
  2. on: [push]
  3. jobs:
  4. # Job to run pre-checks
  5. pre-checks:
  6. runs-on: ubuntu-latest
  7. strategy:
  8. matrix:
  9. python-version: [3.8]
  10. steps:
  11. - name: Checkout the repository
  12. uses: actions/checkout@v2
  13. - name: Setup Python
  14. uses: actions/setup-python@v1
  15. with:
  16. python-version: ${{ matrix.python-version }}
  17. - name: Install package
  18. run: |
  19. pip install poetry
  20. poetry install
  21. - name: Run pre-checks
  22. run: |
  23. poetry run flake8 kafkaesk --config=.flake8
  24. poetry run mypy kafkaesk/
  25. poetry run isort -c -rc kafkaesk/
  26. poetry run black --check --verbose kafkaesk
  27. # Job to run tests
  28. tests:
  29. runs-on: ubuntu-latest
  30. strategy:
  31. matrix:
  32. python-version: [3.8]
  33. steps:
  34. - name: Checkout the repository
  35. uses: actions/checkout@v2
  36. - name: Setup Python
  37. uses: actions/setup-python@v1
  38. with:
  39. python-version: ${{ matrix.python-version }}
  40. - name: Start Docker containers for Zookeeper and Kafka
  41. run: docker-compose up -d
  42. - name: Install the package
  43. run: |
  44. pip install poetry
  45. poetry install
  46. - name: Run tests
  47. run: |
  48. poetry run pytest -rfE --reruns 2 --cov=kafkaesk -s --tb=native -v --cov-report xml --cov-append tests
  49. - name: Upload coverage to Codecov
  50. uses: codecov/codecov-action@v1
  51. with:
  52. file: ./coverage.xml