-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (49 loc) · 1.55 KB
/
checks.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
name: checks
on:
- push
- pull_request
- workflow_dispatch
jobs:
check-pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.dev.txt
- run: |
pip install pre-commit
pip install -e .
pip install -r requirements.dev.txt
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pre-commit run --show-diff-on-failure --color=always --all-files
test:
name: test py=${{ matrix.py_version }} django=${{ matrix.django_version }} drf=${{ matrix.drf_version }}
strategy:
fail-fast: false
matrix:
py_version: [ "3.9", "3.10", "3.11" ]
django_version: ["3.2", "4.0", "4.1"]
drf_version: ["3.13", "3.14"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.py_version }}"
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.dev.txt
- name: Install dependencies
run: |
pip install .[django,djangorestframework] -r requirements.dev.txt django==${{ matrix.django_version }} djangorestframework==${{ matrix.drf_version }}
- name: Run tests
run: pytest