1+ name : Test
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ mysql :
7+ runs-on : ubuntu-latest
8+ strategy :
9+ fail-fast : false
10+ max-parallel : 5
11+ matrix :
12+ python-version : ['3.5', '3.6', '3.7', '3.8']
13+
14+ services :
15+ mariadb :
16+ image : mariadb:10.3
17+ env :
18+ MYSQL_ROOT_PASSWORD : debug_toolbar
19+ options : >-
20+ --health-cmd "mysqladmin ping"
21+ --health-interval 10s
22+ --health-timeout 5s
23+ --health-retries 5
24+ ports :
25+ - 3306:3306
26+
27+ steps :
28+ - uses : actions/checkout@v2
29+
30+ - name : Set up Python ${{ matrix.python-version }}
31+ uses : actions/setup-python@v2
32+ with :
33+ python-version : ${{ matrix.python-version }}
34+
35+ - name : Get pip cache dir
36+ id : pip-cache
37+ run : |
38+ echo "::set-output name=dir::$(pip cache dir)"
39+ - name : Cache
40+ uses : actions/cache@v2
41+ with :
42+ path : ${{ steps.pip-cache.outputs.dir }}
43+ key :
44+ ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
45+ restore-keys : |
46+ ${{ matrix.python-version }}-v1-
47+ - name : Install dependencies
48+ run : |
49+ python -m pip install --upgrade pip
50+ python -m pip install --upgrade tox tox-gh-actions
51+ - name : Test with tox
52+ run : tox
53+ env :
54+ DB_BACKEND : mysql
55+ DB_USER : root
56+ DB_PASSWORD : debug_toolbar
57+ DB_HOST : 127.0.0.1
58+ DB_PORT : 3306
59+
60+ - name : Upload coverage
61+ uses : codecov/codecov-action@v1
62+ with :
63+ name : Python ${{ matrix.python-version }}
64+
65+ postgres :
66+ runs-on : ubuntu-latest
67+ strategy :
68+ fail-fast : false
69+ max-parallel : 5
70+ matrix :
71+ python-version : ['3.5', '3.6', '3.7', '3.8']
72+
73+ services :
74+ postgres :
75+ image : ' postgres:9.5'
76+ env :
77+ POSTGRES_DB : debug_toolbar
78+ POSTGRES_USER : debug_toolbar
79+ POSTGRES_PASSWORD : debug_toolbar
80+ ports :
81+ - 5432:5432
82+ options : >-
83+ --health-cmd pg_isready
84+ --health-interval 10s
85+ --health-timeout 5s
86+ --health-retries 5
87+ steps :
88+ - uses : actions/checkout@v2
89+
90+ - name : Set up Python ${{ matrix.python-version }}
91+ uses : actions/setup-python@v2
92+ with :
93+ python-version : ${{ matrix.python-version }}
94+
95+ - name : Get pip cache dir
96+ id : pip-cache
97+ run : |
98+ echo "::set-output name=dir::$(pip cache dir)"
99+ - name : Cache
100+ uses : actions/cache@v2
101+ with :
102+ path : ${{ steps.pip-cache.outputs.dir }}
103+ key :
104+ ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
105+ restore-keys : |
106+ ${{ matrix.python-version }}-v1-
107+ - name : Install dependencies
108+ run : |
109+ python -m pip install --upgrade pip
110+ python -m pip install --upgrade tox tox-gh-actions
111+ - name : Test with tox
112+ run : tox
113+ env :
114+ DB_BACKEND : postgresql
115+ DB_HOST : localhost
116+ DB_PORT : 5432
117+
118+ - name : Upload coverage
119+ uses : codecov/codecov-action@v1
120+ with :
121+ name : Python ${{ matrix.python-version }}
122+
123+ sqlite :
124+ runs-on : ubuntu-latest
125+ strategy :
126+ fail-fast : false
127+ max-parallel : 5
128+ matrix :
129+ python-version : ['3.5', '3.6', '3.7', '3.8']
130+
131+ steps :
132+ - uses : actions/checkout@v2
133+
134+ - name : Set up Python ${{ matrix.python-version }}
135+ uses : actions/setup-python@v2
136+ with :
137+ python-version : ${{ matrix.python-version }}
138+
139+ - name : Get pip cache dir
140+ id : pip-cache
141+ run : |
142+ echo "::set-output name=dir::$(pip cache dir)"
143+ - name : Cache
144+ uses : actions/cache@v2
145+ with :
146+ path : ${{ steps.pip-cache.outputs.dir }}
147+ key :
148+ ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
149+ restore-keys : |
150+ ${{ matrix.python-version }}-v1-
151+ - name : Install dependencies
152+ run : |
153+ python -m pip install --upgrade pip
154+ python -m pip install --upgrade tox tox-gh-actions
155+ - name : Test with tox
156+ run : tox
157+ env :
158+ DB_BACKEND : sqlite3
159+ DB_NAME : " :memory:"
160+
161+ - name : Upload coverage
162+ uses : codecov/codecov-action@v1
163+ with :
164+ name : Python ${{ matrix.python-version }}
165+
166+ lint :
167+ runs-on : ubuntu-latest
168+ strategy :
169+ fail-fast : false
170+
171+ steps :
172+ - uses : actions/checkout@v2
173+
174+ - name : Set up Python ${{ matrix.python-version }}
175+ uses : actions/setup-python@v2
176+ with :
177+ python-version : 3.7
178+
179+ - name : Get pip cache dir
180+ id : pip-cache
181+ run : |
182+ echo "::set-output name=dir::$(pip cache dir)"
183+ - name : Cache
184+ uses : actions/cache@v2
185+ with :
186+ path : ${{ steps.pip-cache.outputs.dir }}
187+ key :
188+ ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
189+ restore-keys : |
190+ ${{ matrix.python-version }}-v1-
191+ - name : Install dependencies
192+ run : |
193+ python -m pip install --upgrade pip
194+ python -m pip install --upgrade tox
195+ - name : Test with tox
196+ run : tox -e style,readme
0 commit comments