-
Notifications
You must be signed in to change notification settings - Fork 4
145 lines (125 loc) · 4.28 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ '**' ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
DJANGO_VERSION: ['3.0.*', '3.1.*', '3.2.*', '4.0.*', '4.1.*', '4.2.*', '5.0.*', '5.1.*']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- DJANGO_VERSION: '5.1.*'
python-version: '3.9'
- DJANGO_VERSION: '5.1.*'
python-version: '3.8'
- DJANGO_VERSION: '5.1.*'
python-version: '3.7'
- DJANGO_VERSION: '5.0.*'
python-version: '3.9'
- DJANGO_VERSION: '5.0.*'
python-version: '3.8'
- DJANGO_VERSION: '5.0.*'
python-version: '3.7'
- DJANGO_VERSION: '4.2.*'
python-version: '3.7'
- DJANGO_VERSION: '4.1.*'
python-version: '3.12'
- DJANGO_VERSION: '4.1.*'
python-version: '3.7'
- DJANGO_VERSION: '4.0.*'
python-version: '3.12'
- DJANGO_VERSION: '4.0.*'
python-version: '3.11'
- DJANGO_VERSION: '4.0.*'
python-version: '3.7'
- DJANGO_VERSION: '3.2.*'
python-version: '3.12'
- DJANGO_VERSION: '3.2.*'
python-version: '3.11'
- DJANGO_VERSION: '3.1.*'
python-version: '3.12'
- DJANGO_VERSION: '3.1.*'
python-version: '3.11'
- DJANGO_VERSION: '3.1.*'
python-version: '3.10'
- DJANGO_VERSION: '3.0.*'
python-version: '3.12'
- DJANGO_VERSION: '3.0.*'
python-version: '3.11'
- DJANGO_VERSION: '3.0.*'
python-version: '3.10'
fail-fast: false
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('setup.py') }}-${{ matrix.DJANGO_VERSION }}
- name: Install
run: |
pip install setuptools
python setup.py develop
pip install -e .
pip install -r requirements.txt
pip install requests-mock mock pytest coveralls
pip install psycopg2==2.8.6
pip install Django==${{ matrix.DJANGO_VERSION }} --pre
pip install codecov
- name: Testing
run: |
PYTHONPATH=`pwd` python -W error::DeprecationWarning -m coverage run --source=payments_payu ./manage.py test
coverage xml && codecov
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost/postgres"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('setup.py') }}-${{ matrix.DJANGO_VERSION }}
- name: Install
run: |
pip install setuptools flake8 isort black mypy django-stubs dj_database_url types-six types-requests types-mock
python setup.py develop
pip install -e .
pip install -r requirements.txt
- name: Running Flake8
run: flake8
- name: Running isort
run: python -m isort payments_payu --check-only --diff
- name: Running black
run: black --check payments_payu
- name: Running mypy
run: mypy payments_payu