-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (45 loc) · 1.23 KB
/
python-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Run Python unit-tests
on:
push:
branches:
- main
paths:
- python/**
- .github/workflows/python-test.yml
pull_request:
paths:
- python/**
- .github/workflows/python-test.yml
defaults:
run:
working-directory: ./python/zeroeventhub
jobs:
build:
name: Install Python and Poetry, then lint and run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11.9'
- name: Install and configure Poetry
run: |
pip install poetry==1.8.3
poetry config virtualenvs.in-project true
- run: poetry install --sync
name: Install dependencies
# lint
- run: poetry run black --check --diff tests/ zeroeventhub/
name: Run black
- run: poetry run flake8
name: Run flake8
- run: poetry run pylint zeroeventhub/
name: Run pylint
- run: poetry run mypy
name: Check types
# test
- run: poetry run coverage run --branch -m pytest
name: Run unit tests
- run: poetry run coverage report --fail-under 98 --omit='tests/**'
name: Show code coverage