forked from datastax/python-driver
-
Notifications
You must be signed in to change notification settings - Fork 42
155 lines (123 loc) · 5.57 KB
/
build-push.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build and upload to PyPi
on: [push, pull_request]
env:
CIBW_TEST_COMMAND_LINUX: "pytest --import-mode append {project}/tests/unit -k 'not (test_connection_initialization or test_cloud)' && EVENT_LOOP_MANAGER=gevent pytest --import-mode append {project}/tests/unit/io/test_geventreactor.py && EVENT_LOOP_MANAGER=eventlet pytest --import-mode append {project}/tests/unit/io/test_eventletreactor.py "
CIBW_TEST_COMMAND_MACOS: "pytest --import-mode append {project}/tests/unit -k 'not (test_multi_timer_validation or test_empty_connections or test_connection_initialization or test_timer_cancellation or test_cloud)' "
CIBW_TEST_COMMAND_WINDOWS: "pytest --import-mode append {project}/tests/unit -k \"not (test_deserialize_date_range_year or test_datetype or test_libevreactor or test_connection_initialization or test_cloud)\" "
CIBW_BEFORE_TEST: "pip install -r {project}/test-requirements.txt"
CIBW_BEFORE_BUILD_LINUX: "rm -rf ~/.pyxbld && yum install -y libffi-devel libev libev-devel openssl openssl-devel"
CIBW_ENVIRONMENT: "CASS_DRIVER_BUILD_CONCURRENCY=2 CFLAGS='-g0 -O3'"
CIBW_SKIP: cp35* cp36* *musllinux*
jobs:
build_wheels:
name: Build wheels ${{ matrix.os }} (${{ matrix.platform }})
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build')) || github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: x86_64
- os: ubuntu-latest
platform: i686
- os: ubuntu-latest
platform: PyPy
- os: windows-latest
platform: win32
- os: windows-latest
platform: win64
- os: windows-latest
platform: PyPy
- os: macos-latest
platform: all
- os: macos-latest
platform: PyPy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.12.1
- name: Install OpenSSL for Windows
if: runner.os == 'Windows'
run: |
choco install openssl -f -y
- name: Install OpenSSL for MacOS
if: runner.os == 'MacOs'
run: |
brew install libev
- name: Overwrite for Linux 64
if: runner.os == 'Linux' && matrix.platform == 'x86_64'
run: |
echo "CIBW_BUILD=cp3*_x86_64" >> $GITHUB_ENV
- name: Overwrite for Linux 32
if: runner.os == 'Linux' && matrix.platform == 'i686'
run: |
echo "CIBW_BUILD=cp*_i686" >> $GITHUB_ENV
echo "CIBW_TEST_COMMAND_LINUX=" >> $GITHUB_ENV
- name: Overwrite for Linux PyPy
if: runner.os == 'Linux' && matrix.platform == 'PyPy'
run: |
echo "CIBW_BUILD=pp*" >> $GITHUB_ENV
echo "CIBW_TEST_COMMAND_LINUX=" >> $GITHUB_ENV
- name: Overwrite for Windows 64
if: runner.os == 'Windows' && matrix.platform == 'win64'
run: |
echo "CIBW_BUILD=cp*win_amd64" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Overwrite for Windows 32
if: runner.os == 'Windows' && matrix.platform == 'win32'
run: |
echo "CIBW_BUILD=cp*win32" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Overwrite for Windows PyPY
if: runner.os == 'Windows' && matrix.platform == 'PyPy'
run: |
echo "CIBW_BUILD=pp*" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "CIBW_TEST_COMMAND_WINDOWS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Overwrite for MacOs
if: runner.os == 'MacOs' && matrix.platform == 'all'
run: |
echo "CIBW_BUILD=cp37* cp38*" >> $GITHUB_ENV
echo "CIBW_BEFORE_TEST_MACOS=pip install -r {project}/test-requirements.txt pytest" >> $GITHUB_ENV
- name: Overwrite for MacOs PyPy
if: runner.os == 'MacOs' && matrix.platform == 'PyPy'
run: |
echo "CIBW_BUILD=pp*" >> $GITHUB_ENV
echo "CIBW_BEFORE_TEST_MACOS=pip install -r {project}/test-requirements.txt pytest" >> $GITHUB_ENV
echo "CIBW_TEST_COMMAND_MACOS=" >> $GITHUB_ENV
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build'))|| github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && endsWith(github.event.ref, 'scylla')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}