-
-
Notifications
You must be signed in to change notification settings - Fork 125
91 lines (89 loc) · 2.49 KB
/
main.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
name: Run Tests
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- v*
pull_request:
branches:
- main
- v*
release:
types:
- released
jobs:
typing:
name: Typing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: poetry
- name: Install dependencies
run: |
poetry install -E debug-toolbar
- name: Check for pyright errors
uses: jakebailey/pyright-action@v1
with:
# FIXME: Enable this for the whole project once we fix
# all pyright issues on tests directory
extra-args: strawberry_django
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
django-version:
- 3.2.*
- 4.0.*
- 4.1.*
- 4.2.*
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
mode:
- std
- geos
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install OS Dependencies
if: ${{ matrix.mode == 'geos' }}
uses: daaku/gh-action-apt-install@v4
with:
packages: binutils gdal-bin libproj-dev libsqlite3-mod-spatialite
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Install & Cache Dependencies
id: cache-deps
uses: allanchain/poetry-cache-action@release
with:
upload-strategy: on-success
cache-key-prefix: python${{ matrix.python-version }}-django${{ matrix.django-version }}
- name: Install Django ${{ matrix.django-version }}
if: ${{ !steps.cache-deps.outputs.cache-hit }}
run: poetry run pip install "django==${{ matrix.django-version }}"
- name: Test with pytest
run: poetry run pytest --showlocals -vvv --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}