forked from MagicStack/asyncpg
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (116 loc) · 3.66 KB
/
Copy pathtests.yml
File metadata and controls
137 lines (116 loc) · 3.66 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
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
name: Tests
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
jobs:
test-platforms:
# NOTE: this matrix is for testing various combinations of Python and OS
# versions on the system-installed PostgreSQL version (which is usually
# fairly recent). For a PostgreSQL version matrix see the test-postgres
# job.
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
# Python 3.5 is unable to properly
# find the recent VS tooling
# https://bugs.python.org/issue30389
- os: windows-latest
python-version: 3.5
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 50
submodules: true
- name: Check if release PR.
uses: edgedb/action-release/validate-pr@master
continue-on-error: true
id: release
with:
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
version_file: asyncpg/_version.py
version_line_pattern: |
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
if: steps.release.outputs.version == 0
with:
python-version: ${{ matrix.python-version }}
- name: Configure PostgreSQL Environment
if: matrix.os == 'windows-latest'
run: |
echo PGINSTALLATION="${PGBIN}" >> "${GITHUB_ENV}"
- name: Install Python Deps
if: steps.release.outputs.version == 0
run: |
pip install -e .[test]
- name: Test
if: steps.release.outputs.version == 0
run: |
python setup.py test
- name: Test under uvloop
if: steps.release.outputs.version == 0 && matrix.os != 'windows-latest' && matrix.python-version != '3.9'
run: |
env USE_UVLOOP=1 python setup.py test
test-postgres:
strategy:
matrix:
postgres-version: [9.5, 9.6, 10, 11, 12, 13]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 50
submodules: true
- name: Check if release PR.
uses: edgedb/action-release/validate-pr@master
continue-on-error: true
id: release
with:
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
version_file: asyncpg/_version.py
version_line_pattern: |
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
- name: Set up PostgreSQL
if: steps.release.outputs.version == 0
env:
PGVERSION: ${{ matrix.postgres-version }}
DISTRO_NAME: focal
run: |
sudo env DISTRO_NAME="${DISTRO_NAME}" PGVERSION="${PGVERSION}" \
.github/workflows/install-postgres.sh
echo PGINSTALLATION="/usr/lib/postgresql/${PGVERSION}/bin" \
>> "${GITHUB_ENV}"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
if: steps.release.outputs.version == 0
with:
python-version: ${{ matrix.python-version }}
- name: Install Python Deps
if: steps.release.outputs.version == 0
run: |
pip install -e .[test]
- name: Test
if: steps.release.outputs.version == 0
env:
PGVERSION: ${{ matrix.postgres-version }}
run: |
python setup.py test
# This job exists solely to act as the test job aggregate to be
# targeted by branch policies.
regression-tests:
name: "Regression Tests"
needs: [test-platforms, test-postgres]
runs-on: ubuntu-20.04
steps:
- run: echo OK