-
Notifications
You must be signed in to change notification settings - Fork 13
60 lines (53 loc) · 1.51 KB
/
cicd.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
49
50
51
52
53
54
55
56
57
58
59
60
---
name: Run Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types:
- released
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
with:
extra_args: -a
tests:
runs-on: ubuntu-latest
strategy:
matrix:
django-version: ["2.2.0", "3.0.0", "3.1.0", "3.2.0", "4.0.0", "4.1.0"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install poetry
poetry install
poetry run pip install "Django~=${{ matrix.django-version }}"
- name: Run tests
run: |
poetry run pytest --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
publish:
runs-on: ubuntu-latest
needs: [lint, tests]
if: ${{ needs.lint.result == 'success' && needs.tests.result == 'success' && github.event.action == 'released' }}
steps:
- uses: actions/checkout@v2
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}