-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (134 loc) · 5.42 KB
/
Copy pathci.yml
File metadata and controls
161 lines (134 loc) · 5.42 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
158
159
160
161
name: python-sdk-ci
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
jobs:
test:
name: ${{ matrix.os }} / Python ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.11", "3.13"]
steps:
- name: Check out Python SDK
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
with:
path: sdk-python
- name: Install Rust 1.95
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772
with:
toolchain: 1.95.0
components: clippy, rustfmt
- name: Install Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
with:
python-version: ${{ matrix.python }}
- name: Install Linux native dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --yes libasound2-dev libpipewire-0.3-dev
- name: Install SDK and development gates
working-directory: sdk-python
run: |
python -m pip install --upgrade pip
python -m pip install "maturin>=1.9.4,<2.0" "pytest>=8.0" "pytest-asyncio>=0.23" "mypy>=1.15" "ruff>=0.11" "websockets>=17.0,<18"
maturin build --release --locked --features conformance-fixtures --out dist-conformance
python -c "from pathlib import Path; import subprocess, sys; wheel = next(Path('dist-conformance').glob('*.whl')); subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--force-reinstall', str(wheel)])"
- name: Rust formatting
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
working-directory: sdk-python
run: cargo fmt --manifest-path native/Cargo.toml -- --check
- name: Native conformance
working-directory: sdk-python
run: cargo test --manifest-path native/Cargo.toml --all-features --locked
- name: Native lint
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
working-directory: sdk-python
run: cargo clippy --manifest-path native/Cargo.toml --all-targets --all-features --locked -- -D warnings
- name: Python lint and formatting
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
working-directory: sdk-python
run: |
ruff check python tests examples
ruff format --check python tests examples
- name: Public documentation language
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
working-directory: sdk-python
shell: bash
run: |
if rg -n -i '\b(boundary|path|surface|authority|projection|lowering|flow|layer|bounded|contracts?)\b' \
README.md RELEASE_NOTES.md docs examples \
--glob '*.md' --glob '*.mdx'; then
echo "Public documentation must name the API, queue, limit, process, service, or request directly."
exit 1
fi
- name: Python type contract
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
working-directory: sdk-python
run: mypy python examples tests/qualification
- name: Python tests
working-directory: sdk-python
run: python -m pytest
- name: Build wheel
working-directory: sdk-python
env:
CARGO_TARGET_DIR: native/target-release
run: maturin build --release --locked --out dist
- name: Test isolated release wheel
working-directory: sdk-python
run: >-
python tests/run_artifact_consumer.py
--artifact-kind wheel
--artifact-dir dist
- name: Upload wheel for inspection
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: pocketstation-${{ matrix.os }}-py${{ matrix.python }}
path: sdk-python/dist/*.whl
if-no-files-found: error
sdist:
name: source distribution / Python 3.11
runs-on: ubuntu-latest
steps:
- name: Check out Python SDK
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
with:
path: sdk-python
- name: Install Rust 1.95
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772
with:
toolchain: 1.95.0
- name: Install Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
with:
python-version: "3.11"
- name: Install Linux native dependencies
run: |
sudo apt-get update
sudo apt-get install --yes libasound2-dev libpipewire-0.3-dev
- name: Build source distribution
working-directory: sdk-python
run: |
python -m pip install --upgrade pip
python -m pip install "maturin>=1.9.4,<2.0"
maturin sdist --manifest-path native/Cargo.toml --out dist
- name: Rebuild and test isolated source distribution
working-directory: sdk-python
run: >-
python tests/run_artifact_consumer.py
--artifact-kind sdist
--artifact-dir dist
- name: Upload source distribution for inspection
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: pocketstation-sdist
path: sdk-python/dist/*.tar.gz
if-no-files-found: error