-
-
Notifications
You must be signed in to change notification settings - Fork 147
141 lines (119 loc) · 4.24 KB
/
packages.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
name: Build packages
on:
workflow_dispatch:
jobs:
linux:
name: Build Linux packages
runs-on: ubuntu-20.04
strategy:
matrix:
pyver: [cp36, cp37, cp38, cp39]
arch: [x86_64, i686, ppc64le, aarch64]
steps:
- uses: actions/checkout@v2
- name: Set up QEMU for multi-arch build
uses: docker/setup-qemu-action@v1
- name: Create the binary package source tree
run: python3 ./tools/build/copy_to_binary.py
- name: Build wheels
uses: pypa/cibuildwheel@v1.12.0
with:
package-dir: psycopg_binary
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24
CIBW_MANYLINUX_I686_IMAGE: manylinux_2_24
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_24
CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux_2_24
CIBW_BUILD: ${{matrix.pyver}}-manylinux_${{matrix.arch}}
CIBW_ARCHS_LINUX: auto aarch64 ppc64le
CIBW_BEFORE_ALL_LINUX: ./tools/build/wheel_linux_before_all.sh
CIBW_BEFORE_TEST: pip install ./psycopg[test]
CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes
CIBW_ENVIRONMENT: >-
PSYCOPG_IMPL=binary
PSYCOPG_TEST_DSN='host=172.17.0.1 user=postgres'
PGPASSWORD=password
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
services:
postgresql:
image: postgres:13
env:
POSTGRES_PASSWORD: password
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
macos:
name: Build MacOS packages
runs-on: macos-10.15
strategy:
matrix:
pyver: [cp36, cp37, cp38, cp39]
arch: [x86_64]
# These archs require an Apple M1 runner: [arm64, universal2]
steps:
- uses: actions/checkout@v2
- name: Create the binary package source tree
run: python3 ./tools/build/copy_to_binary.py
- name: Build wheels
uses: pypa/cibuildwheel@v1.12.0
with:
package-dir: psycopg_binary
env:
CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}}
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_BEFORE_ALL_MACOS: ./tools/build/wheel_macos_before_all.sh
CIBW_BEFORE_TEST: pip install ./psycopg[test]
CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes
CIBW_ENVIRONMENT: >-
PSYCOPG_IMPL=binary
PSYCOPG_TEST_DSN='dbname=postgres'
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
windows:
name: Build Windows packages
runs-on: windows-2019
# TODO: Currently disabled: not completed yet. See the
# wheel_windows_before_all script.
if: false
strategy:
matrix:
pyver: [cp36, cp37, cp38, cp39]
arch: [win_amd64]
# Might want to add win32, untested at the moment.
steps:
- uses: actions/checkout@v2
- name: Start PostgreSQL service for test
run: |
$postgreSqlSvc = Get-Service "postgresql*"
Set-Service $postgreSqlSvc.Name -StartupType manual
$postgreSqlSvc.Start()
- name: Create the binary package source tree
run: python3 ./tools/build/copy_to_binary.py
- name: Build wheels
uses: pypa/cibuildwheel@v1.12.0
with:
package-dir: psycopg_binary
env:
CIBW_BUILD: ${{matrix.pyver}}-${{matrix.arch}}
CIBW_ARCHS_WINDOWS: AMD64 x86
CIBW_BEFORE_ALL_WINDOWS: >-
powershell.exe tools\build\wheel_windows_before_all.ps1
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair -w {dest_dir} {wheel}
CIBW_BEFORE_TEST: pip install ./psycopg[test]
CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes
CIBW_ENVIRONMENT: >-
PSYCOPG_IMPL=binary
PSYCOPG_TEST_DSN='host=172.17.0.1 user=postgres'
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl