-
Notifications
You must be signed in to change notification settings - Fork 160
92 lines (88 loc) · 2.15 KB
/
ci.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
name: CI
on:
push:
branches:
- master
- '[0-9].[0-9]+'
tags: [ 'v*' ]
pull_request:
branches:
- master
- '[0-9].[0-9]+'
jobs:
test:
name: Test on Python ${{ matrix.python }}
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
sqlalchemy: ['sqlalchemy[postgresql_psycopg2binary]>=1.4,<1.5', 'sqlalchemy[postgresql_psycopg2binary]>=2.0,<2.1']
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install -e .
pip install -r requirements.txt
pip install codecov
- name: Install ${{ matrix.sqlalchemy }}
run: |
pip install "${{ matrix.sqlalchemy }}"
- name: Run tests
run: |
make cov-ci
python setup.py check -rms
codecov
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install -e .
pip install -r requirements.txt
- name: Run linters
run: |
make lint
deploy:
name: Deploy
runs-on: ubuntu-latest
needs:
- test
- lint
# Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run:
python -m pip install -U pip wheel twine
- name: Make dists
run:
python setup.py sdist bdist_wheel
- name: Check dists
run:
twine check dist/*
- name: PyPI upload
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*