generated from brylie/django-bootstrap-quick-start
-
Notifications
You must be signed in to change notification settings - Fork 18
41 lines (38 loc) · 1.19 KB
/
python.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
name: python
on:
push:
branches: main
pull_request:
branches: main
jobs:
lint:
name: "Lint and test"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Poetry
run: python -m pip install --user poetry
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Lint with isort
run: poetry run isort . --check
- name: Lint with black
run: poetry run black . --check
- name: Lint with flake8
run: poetry run pflake8 .
- name: Run tests
run: poetry run python project/manage.py test
- name: Generate test coverage report
run: poetry run coverage run project/manage.py test project
- name: Prepare test coverage repoirt for upload
run: poetry run coverage xml
- name: Upload test coverage report
uses: codecov/codecov-action@v3