-
Notifications
You must be signed in to change notification settings - Fork 439
157 lines (132 loc) · 4.47 KB
/
tests.yml
File metadata and controls
157 lines (132 loc) · 4.47 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Tests
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
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.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
os: [ubuntu-24.04, macos-15, windows-2025]
loop: [asyncio, uvloop]
exclude:
# uvloop does not support windows
- loop: uvloop
os: windows-2025
# github does not provide 3.9 cpython for arm64 runners
- python-version: "3.9"
os: macos-15
runs-on: ${{ matrix.os }}
permissions: {}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 50
submodules: true
persist-credentials: false
- name: Check if release PR.
uses: edgedb/action-release/validate-pr@master
id: release
with:
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
missing_version_ok: yes
version_file: asyncpg/_version.py
version_line_pattern: |
__version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
- name: Set up PostgreSQL
if: "!steps.release.outputs.is_release && startsWith(matrix.os, 'macos')"
run: |
POSTGRES_FORMULA="postgresql@18"
brew install "$POSTGRES_FORMULA"
echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> $GITHUB_PATH
- name: Set up Kerberos
if: "!steps.release.outputs.is_release && startsWith(matrix.os, 'ubuntu')"
run: .github/workflows/install-krb5.sh
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
if: "!steps.release.outputs.is_release"
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- name: Install Python Deps
if: "!steps.release.outputs.is_release"
run: |
uv pip install -e . --group test
- name: Test
if: "!steps.release.outputs.is_release"
env:
USE_UVLOOP: ${{ matrix.loop == 'uvloop' && '1' || '' }}
run: python -m unittest -v tests.suite
test-postgres:
strategy:
matrix:
postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15", "16", "17", "18"]
runs-on: ubuntu-24.04
permissions: {}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 50
submodules: true
persist-credentials: false
- name: Check if release PR.
uses: edgedb/action-release/validate-pr@master
id: release
with:
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
missing_version_ok: yes
version_file: asyncpg/_version.py
version_line_pattern: |
__version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
- name: Set up PostgreSQL
if: "!steps.release.outputs.is_release"
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 Kerberos
if: "!steps.release.outputs.is_release"
run: .github/workflows/install-krb5.sh
- name: Set up Python
uses: astral-sh/setup-uv@v7
if: "!steps.release.outputs.is_release"
with:
activate-environment: true
- name: Install Python Deps
if: "!steps.release.outputs.is_release"
run: |
uv pip install -e . --group test
- name: Test
if: "!steps.release.outputs.is_release"
env:
PGVERSION: ${{ matrix.postgres-version }}
run: |
python -m unittest -v tests.suite
# 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-24.04
permissions: {}
steps:
- run: echo OK