-
Notifications
You must be signed in to change notification settings - Fork 2
105 lines (83 loc) · 2.16 KB
/
tests.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * 0"
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Workaround mpyp not type-checking wsgidav
run: poetry run python -m manabi.mypy_fix
- name: Run mypy
run: poetry run mypy manabi
- name: Run ruff
run: |
ruff format manabi/ --check
ruff check manabi/ --output-format=github
compatibility-tests:
name: Compatibility tests
needs: [lint]
runs-on: ubuntu-latest
strategy:
matrix:
version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
services:
postgres:
image: postgres:alpine
env:
POSTGRES_DB: manabi
POSTGRES_USER: manabi
POSTGRES_PASSWORD: manabi
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Set hypothesis to ci-profile
run: echo "HYPOTHESIS_PROFILE=ci" >> $GITHUB_ENV
- name: Setup environment
run: sudo apt-get install -y libsodium23
- name: Install poetry
run: pipx install poetry
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
cache: "poetry"
- name: Install dependendies
run: poetry install
- name: Run migrations
run: poetry run python manabi_django/manage.py migrate manabi_migrations
- name: Run tests
run: poetry run pytest -v manabi