-
Notifications
You must be signed in to change notification settings - Fork 17
80 lines (76 loc) · 2.21 KB
/
general.yml
File metadata and controls
80 lines (76 loc) · 2.21 KB
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
name: general
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main
jobs:
test-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
sqlalchemy-version: [1.4, 2.0]
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
mysql:
image: mysql:8
env:
MYSQL_USER: test_user
MYSQL_PASSWORD: test_password
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_db
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
ports:
- 3306:3306
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make install
pip install "sqlalchemy>=${{ matrix.sqlalchemy-version }}"
- name: Test software
env:
POSTGRES_URL: postgresql://postgres:postgres@localhost:5432/postgres
SQLITE_URL: 'sqlite:///:memory:'
MYSQL_URL: mysql+pymysql://test_user:test_password@localhost:3306/test_db?charset=utf8
run: make test
- name: Report coverage
uses: codecov/codecov-action@v1
release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [test-linux]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build distribution
run: |
python setup.py sdist bdist_wheel
- name: Publish to PYPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_KEY }}