-
Notifications
You must be signed in to change notification settings - Fork 2.4k
214 lines (199 loc) · 6.57 KB
/
pythonbuild.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: Build
on:
push:
branches:
- master
pull_request:
jobs:
core:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- python-version: "3.6"
tox-env: py36-core
- python-version: "3.7"
tox-env: py37-core
- python-version: "3.8"
tox-env: py38-core
- python-version: "3.9"
tox-env: py39-core
- python-version: "3.10"
tox-env: py310-core
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements files
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox<4.0'
- name: Setup MySQL DB
run: |
sudo /etc/init.d/mysql start
mysql -e 'create database IF NOT EXISTS luigi_test;' -uroot -proot || true
mysql -e 'create user 'travis'@'localhost';' -uroot -proot || true
mysql -e 'grant all privileges ON *.* TO 'travis'@'localhost';' -uroot -proot || true
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
run: tox
- name: Codecov
env:
COVERAGE_PROCESS_START: .coveragerc
run: |
pip install codecov
codecov -e ${{ matrix.tox-env }}
postgres:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
include:
- python-version: "3.6"
tox-env: py36-postgres
- python-version: "3.7"
tox-env: py37-postgres
- python-version: "3.8"
tox-env: py38-postgres
- python-version: "3.9"
tox-env: py39-postgres
- python-version: "3.10"
tox-env: py310-postgres
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements files
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox<4.0'
- name: Create PSQL database
run: |
PGPASSWORD=postgres psql -h localhost -p 5432 -c 'create database spotify;' -U postgres
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
run: tox
- name: Codecov
env:
COVERAGE_PROCESS_START: .coveragerc
run: |
pip install codecov
codecov -e ${{ matrix.tox-env }}
base:
runs-on: ubuntu-20.04
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: accesskey
AWS_SECRET_ACCESS_KEY: secretkey
strategy:
matrix:
include:
- python-version: "3.6"
tox-env: py36-aws
- python-version: "3.7"
tox-env: py37-aws
- python-version: "3.8"
tox-env: py38-aws
- python-version: "3.9"
tox-env: py39-aws
- python-version: "3.10"
tox-env: py310-aws
- python-version: "3.6"
tox-env: py36-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: "3.7"
tox-env: py37-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: "3.8"
tox-env: py38-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: "3.9"
tox-env: py39-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: "3.10"
tox-env: py310-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: "3.6"
tox-env: py36-apache
- python-version: "3.7"
tox-env: py37-apache
- python-version: "3.8"
tox-env: py38-apache
- python-version: "3.9"
tox-env: py39-apache
- python-version: "3.10"
tox-env: py310-apache
- python-version: "3.6"
tox-env: py36-azureblob
- python-version: "3.7"
tox-env: py37-azureblob
- python-version: "3.8"
tox-env: py38-azureblob
- python-version: "3.9"
tox-env: py39-azureblob
- python-version: "3.10"
tox-env: py310-azureblob
- python-version: 3.9
tox-env: flake8
- python-version: 3.9
tox-env: docs
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements files
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox<4.0'
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
OVERRIDE_SKIP_CI_TESTS: ${{ matrix.OVERRIDE_SKIP_CI_TESTS }}
run: tox
- name: Codecov
if: ${{ matrix.tox-env != 'flake8' && matrix.tox-env != 'docs' }}
env:
COVERAGE_PROCESS_START: .coveragerc
run: |
pip install codecov
codecov -e ${{ matrix.tox-env }}