-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (75 loc) · 2.49 KB
/
Copy pathci-python.yml
File metadata and controls
79 lines (75 loc) · 2.49 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
# Fast CI for the Python SDK: builds + runs pytest on a single host
# triple per OS on every push/PR. The full cross-build matrix only
# runs on tag push (see publish-python.yml).
name: ci-python
on:
push:
branches: [main]
paths:
- 'crates/reflow_rt/**'
- 'crates/reflow_components/**'
- 'crates/reflow_network/**'
- 'crates/reflow_graph/**'
- 'crates/reflow_actor/**'
- 'crates/reflow_actor_macro/**'
- 'sdk/python/**'
- '.cargo/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci-python.yml'
pull_request:
paths:
- 'sdk/python/**'
- '.cargo/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci-python.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: dtolnay/rust-toolchain@stable
# The macos-14 runner image presets RUSTC_WRAPPER=sccache but
# doesn't always put sccache on the PATH. Install it so the
# wrapper works; on linux the action is a cheap no-op install.
- uses: mozilla-actions/sccache-action@v0.0.5
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
sdk/python
- name: Install build tools
run: python -m pip install --upgrade pip maturin pytest
- name: Build wheel
working-directory: sdk/python
# abi3-py39 produces one wheel per platform that covers every
# CPython >= 3.9, so we build against the single setup-python
# above instead of enumerating interpreters with --find-interpreter.
run: maturin build --release --out dist
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
- name: Install wheel
shell: bash
run: |
# Install whatever wheel was produced for the active interpreter.
python -m pip install --force-reinstall sdk/python/dist/*.whl
- name: Run tests
shell: bash
# Run from a tmpdir so the source `sdk/python/offbit_reflow`
# directory isn't picked up by pytest's sys.path insertion —
# we want imports to resolve to the wheel installed above.
run: |
cd "$RUNNER_TEMP"
python -m pytest -q "$GITHUB_WORKSPACE/sdk/python/tests"