Skip to content

Commit 32986d6

Browse files
committed
Test macOS wheel build for python 3.12
1 parent 687e1b7 commit 32986d6

File tree

1 file changed

+8
-191
lines changed

1 file changed

+8
-191
lines changed

.github/workflows/ci-pr-validation.yaml

Lines changed: 8 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -27,142 +27,15 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
jobs:
30-
check-and-lint:
31-
name: Lint and check code
32-
runs-on: ubuntu-20.04
33-
steps:
34-
- uses: actions/checkout@v3
35-
- uses: actions/setup-python@v4
36-
with:
37-
python-version: 3.x
38-
- name: Install deps
39-
run: pip install -U pydoctor
40-
- name: Check docs syntax
41-
run: |
42-
pydoctor --make-html \
43-
--html-viewsource-base=https://github.com/apache/pulsar-client-python/tree/main \
44-
--docformat=numpy --theme=readthedocs \
45-
--intersphinx=https://docs.python.org/3/objects.inv \
46-
--html-output=apidocs \
47-
pulsar
48-
49-
unit-tests:
50-
name: Run unit tests for Python ${{matrix.version}}
51-
runs-on: ubuntu-22.04
52-
timeout-minutes: 120
53-
54-
strategy:
55-
fail-fast: false
56-
matrix:
57-
version: ['3.9', '3.13']
58-
59-
steps:
60-
- name: checkout
61-
uses: actions/checkout@v4
62-
63-
- uses: actions/setup-python@v5
64-
with:
65-
python-version: "${{matrix.version}}"
66-
67-
- name: Install Pulsar C++ client
68-
run: build-support/install-dependencies.sh
69-
70-
- name: CMake
71-
run: cmake .
72-
73-
- name: Build
74-
run: make -j8
75-
76-
- name: Python install
77-
run: |
78-
python3 -m pip install -U pip setuptools wheel requests
79-
python3 setup.py bdist_wheel
80-
WHEEL=$(find dist -name '*.whl')
81-
pip3 install ${WHEEL}[avro]
82-
83-
- name: Run Oauth2 tests
84-
run: |
85-
docker compose -f ./build-support/docker-compose-pulsar-oauth2.yml up -d
86-
# Wait until the namespace is created, currently there is no good way to check it via CLI
87-
sleep 10
88-
python3 tests/oauth2_test.py
89-
docker compose -f ./build-support/docker-compose-pulsar-oauth2.yml down
90-
91-
- name: Start Pulsar service
92-
run: ./build-support/pulsar-test-service-start.sh
93-
94-
- name: Run unit tests
95-
run: ./tests/run-unit-tests.sh
96-
97-
- name: Stop Pulsar service
98-
run: ./build-support/pulsar-test-service-stop.sh
99-
100-
- name: Test functions install
101-
run: |
102-
WHEEL=$(find dist -name '*.whl')
103-
pip3 install ${WHEEL}[all] --force-reinstall
104-
105-
linux-wheel:
106-
name: Wheel ${{matrix.image.name}} - Py ${{matrix.python.version}} - ${{matrix.cpu.platform}}
107-
needs: unit-tests
108-
runs-on: ubuntu-22.04
109-
timeout-minutes: 300
110-
111-
strategy:
112-
fail-fast: false
113-
matrix:
114-
image:
115-
- {name: 'manylinux2014', py_suffix: ''}
116-
- {name: 'manylinux_musl', py_suffix: '-alpine'}
117-
python:
118-
- {version: '3.13', spec: 'cp313-cp313'}
119-
cpu:
120-
- {arch: 'x86_64', platform: 'x86_64'}
121-
122-
steps:
123-
- name: checkout
124-
uses: actions/checkout@v3
125-
126-
- name: Set up QEMU
127-
uses: docker/setup-qemu-action@v2
128-
129-
- uses: docker/setup-buildx-action@v2
130-
131-
- name: Build Manylinux Docker image
132-
uses: docker/build-push-action@v3
133-
with:
134-
context: ./pkg/${{matrix.image.name}}
135-
load: true
136-
tags: build:latest
137-
platforms: linux/${{matrix.cpu.arch}}
138-
build-args: |
139-
PLATFORM=${{matrix.cpu.platform}}
140-
ARCH=${{matrix.cpu.arch}}
141-
PYTHON_VERSION=${{matrix.python.version}}
142-
PYTHON_SPEC=${{matrix.python.spec}}
143-
cache-from: type=gha
144-
cache-to: type=gha,mode=max
145-
146-
- name: Build wheel file
147-
run: |
148-
docker run -i -v $PWD:/pulsar-client-python build:latest \
149-
/pulsar-client-python/pkg/build-wheel-inside-docker.sh
150-
151-
- name: Test wheel file
152-
run: |
153-
docker run -i -v $PWD:/pulsar-client-python python:${{matrix.python.version}}${{matrix.image.py_suffix}} \
154-
/pulsar-client-python/pkg/test-wheel.sh
155-
15630
mac-wheels:
15731
name: Wheel MacOS Universal2 - Py ${{matrix.py.version}}
158-
needs: unit-tests
15932
runs-on: macos-14
16033
timeout-minutes: 300
16134

16235
strategy:
16336
matrix:
16437
py:
165-
- {version: '3.13', version_long: '3.13.1'}
38+
- {version: '3.12', version_long: '3.12.8'}
16639

16740
steps:
16841
- name: checkout
@@ -171,81 +44,25 @@ jobs:
17144
- name: Build and test Mac wheels
17245
run: |
17346
pkg/mac/build-mac-wheels.sh ${{matrix.py.version}} ${{matrix.py.version_long}}
47+
ls dist/*.whl
17448
175-
windows-wheels:
176-
name: "Python ${{ matrix.python.version }} Wheel on Windows x64"
177-
needs: unit-tests
178-
runs-on: windows-2019
179-
timeout-minutes: 120
180-
181-
env:
182-
PULSAR_CPP_DIR: 'C:\\pulsar-cpp'
183-
strategy:
184-
fail-fast: false
185-
matrix:
186-
python:
187-
- version: '3.12'
188-
189-
steps:
190-
- uses: actions/checkout@v3
191-
192-
- uses: actions/setup-python@v4
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v3
19351
with:
194-
python-version: ${{ matrix.python.version }}
195-
196-
- name: Download Pulsar C++ client on Windows
197-
shell: bash
198-
run: |
199-
source ./build-support/dep-url.sh
200-
BASE_URL=$(pulsar_cpp_base_url $(grep pulsar-cpp dependencies.yaml | awk '{print $2}'))
201-
mkdir -p ${{ env.PULSAR_CPP_DIR }}
202-
cd ${{ env.PULSAR_CPP_DIR }}
203-
curl -O -L ${BASE_URL}/x64-windows-static.tar.gz
204-
tar zxf x64-windows-static.tar.gz
205-
mv x64-windows-static/* .
206-
ls -l ${{ env.PULSAR_CPP_DIR }}
207-
208-
- name: Configure CMake
209-
shell: bash
210-
run: |
211-
pip3 install pyyaml
212-
export PYBIND11_VERSION=$(./build-support/dep-version.py pybind11)
213-
curl -L -O https://github.com/pybind/pybind11/archive/refs/tags/v${PYBIND11_VERSION}.tar.gz
214-
tar zxf v${PYBIND11_VERSION}.tar.gz
215-
rm -rf pybind11
216-
mv pybind11-${PYBIND11_VERSION} pybind11
217-
cmake -B build -A x64 \
218-
-DCMAKE_PREFIX_PATH=${{ env.PULSAR_CPP_DIR }} \
219-
-DLINK_STATIC=ON
220-
221-
- name: Build Python wheel
222-
shell: bash
223-
run: |
224-
cmake --build build --config Release --target install
225-
python -m pip install wheel setuptools
226-
python setup.py bdist_wheel
227-
python -m pip install ./dist/*.whl
228-
python -c 'import pulsar; c = pulsar.Client("pulsar://localhost:6650"); c.close()'
52+
name: wheel-mac-py${{matrix.py.version}}
53+
path: dist/*.whl
22954

23055
check-completion:
23156
name: Check Completion
23257
runs-on: ubuntu-latest
23358
if: ${{ always() }}
23459
needs: [
235-
check-and-lint,
236-
unit-tests,
237-
linux-wheel,
238-
mac-wheels,
239-
windows-wheels
60+
mac-wheels
24061
]
24162
steps:
24263
- run: |
24364
if [[ ! ( \
244-
"${{ needs.check-and-lint.result }}" == "success" \
245-
&& "${{ needs.unit-tests.result }}" == "success" \
246-
&& "${{ needs.linux-wheel.result }}" == "success" \
247-
&& "${{ needs.mac-wheels.result }}" == "success" \
248-
&& "${{ needs.windows-wheels.result }}" == "success" \
65+
"${{ needs.mac-wheels.result }}" == "success" \
24966
) ]]; then
25067
echo "Required jobs haven't been completed successfully."
25168
exit 1

0 commit comments

Comments
 (0)