-
Notifications
You must be signed in to change notification settings - Fork 179
114 lines (104 loc) · 3.6 KB
/
Copy pathpackage-portability.yml
File metadata and controls
114 lines (104 loc) · 3.6 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
name: Package portability
on:
pull_request:
paths:
- ".github/workflows/package-portability.yml"
- ".github/workflows/publish.yml"
- "pyproject.toml"
- "Cargo.toml"
- "Cargo.lock"
- "crates/**"
- "switchyard/**"
- "switchyard_rust/**"
push:
branches: [main]
paths:
- ".github/workflows/package-portability.yml"
- ".github/workflows/publish.yml"
- "pyproject.toml"
- "Cargo.toml"
- "Cargo.lock"
- "crates/**"
- "switchyard/**"
- "switchyard_rust/**"
workflow_dispatch:
permissions:
contents: read
env:
MATURIN_VERSION: "1.11.5"
jobs:
# Regular CI intentionally builds one wheel only. The complete cross-platform
# wheel matrix is expensive and belongs to the tag-gated release workflow in
# `.github/workflows/publish.yml`.
wheel:
name: Wheel (linux-x86_64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build manylinux x86_64 wheel
shell: bash
run: |
set -euxo pipefail
docker run --rm \
-e MATURIN_VERSION="${MATURIN_VERSION}" \
-v "${GITHUB_WORKSPACE}:/io" \
-w /io \
"quay.io/pypa/manylinux2014_x86_64" \
/bin/bash -lc '
set -euxo pipefail
curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
source "${HOME}/.cargo/env"
PYTHON=/opt/python/cp310-cp310/bin/python
"${PYTHON}" -m pip install --upgrade pip
"${PYTHON}" -m pip install "maturin==${MATURIN_VERSION}"
"${PYTHON}" -m maturin build \
--release \
--locked \
--compatibility pypi \
--out dist \
--interpreter "${PYTHON}"
'
- name: Smoke install wheel on Python 3.10
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --force-reinstall dist/*.whl
python - <<'PY'
import os
import sys
import tempfile
os.chdir(tempfile.mkdtemp(prefix="switchyard-wheel-smoke-"))
workspace = os.environ.get("GITHUB_WORKSPACE")
sys.path = [entry for entry in sys.path if entry not in ("", workspace)]
import switchyard
import switchyard_rust
from switchyard_rust import _switchyard_rust
print("switchyard", switchyard.__version__)
print("switchyard_rust", switchyard_rust.__file__)
print("rust extension", _switchyard_rust.__name__)
PY
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Smoke install wheel on Python 3.14
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --force-reinstall dist/*.whl
python - <<'PY'
import os
import sys
import tempfile
os.chdir(tempfile.mkdtemp(prefix="switchyard-wheel-smoke-"))
workspace = os.environ.get("GITHUB_WORKSPACE")
sys.path = [entry for entry in sys.path if entry not in ("", workspace)]
import switchyard
import switchyard_rust
from switchyard_rust import _switchyard_rust
print("switchyard", switchyard.__version__)
print("switchyard_rust", switchyard_rust.__file__)
print("rust extension", _switchyard_rust.__name__)
PY