-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 2.57 KB
/
python-ci.yml
File metadata and controls
97 lines (81 loc) · 2.57 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
# Python + Rust CI — pytest matrix for the Python package + cargo test
# (and a maturin build smoke check) for the optional Rust acceleration crate.
# Complements scaffold-self-check.yml (Node) and python-lint.yml (ruff).
name: Python + Rust CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
concurrency:
group: python-rust-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
python-tests:
name: pytest (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure Git identity (for fixture commits)
run: |
git config --global user.email "ci@simplicio.dev"
git config --global user.name "Simplicio CI"
git config --global commit.gpgsign false
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Node.js (parity tests run both runtimes)
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install package and pytest
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pytest
- name: Run pytest
run: python -m pytest tests/python -q
rust-tests:
name: cargo test (PyO3 crate)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: cargo-${{ runner.os }}-${{ hashFiles('rust/Cargo.toml') }}
- name: cargo test
run: cargo test --manifest-path rust/Cargo.toml --release
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: maturin develop + native parity test
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e . maturin pytest
(cd rust && maturin develop --release)
python -m pytest tests/python/test_native.py -q