-
Notifications
You must be signed in to change notification settings - Fork 12
122 lines (99 loc) · 3.31 KB
/
Copy pathpython-test.yml
File metadata and controls
122 lines (99 loc) · 3.31 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
name: Python Test
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
UV_PYTHON_DOWNLOADS: 0
jobs:
test-python:
name: ${{ matrix.python-version }}
runs-on: ubuntu-latest
continue-on-error: ${{ endsWith(matrix.python-version, 't') }}
strategy:
fail-fast: false
matrix:
python-version: [
"3.10",
"3.11",
"3.12",
"3.13",
"3.14", "3.14t",
"3.15", "3.15t",
"pypy3.11",
]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable # zizmor: ignore[unpinned-uses]
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
if: github.event_name == 'pull_request' && github.run_attempt == 1
with:
lookup-only: false # zizmor: ignore[cache-poisoning]
shared-key: ${{ matrix.python-version }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: "Install uv"
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: false
- name: "Create and activate .venv"
run: |
uv venv .venv --python ${{ matrix.python-version }}
echo ".venv/bin" >> "$GITHUB_PATH"
echo "PYO3_PYTHON=.venv/bin/python3" >> "$GITHUB_ENV"
- name: "Install dependencies"
run: uv pip install --group ci
- name: "Run maturin"
run: maturin develop --features use-small-offset
- name: "Run pytest"
run: pytest -v -n auto
env:
HYPOTHESIS_PROFILE: slow
test-os:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable # zizmor: ignore[unpinned-uses]
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- name: "Install uv"
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: false
- name: "Create and activate .venv"
shell: bash
run: |
uv venv .venv --python 3.13
if [[ "${{ matrix.os }}" == "windows" ]]; then
echo ".venv/Scripts" >> "$GITHUB_PATH"
echo "PYO3_PYTHON=.venv/Scripts/python" >> "$GITHUB_ENV"
echo "UV_LINK_MODE=copy" >> "$GITHUB_ENV"
else
echo ".venv/bin" >> "$GITHUB_PATH"
echo "PYO3_PYTHON=.venv/bin/python3" >> "$GITHUB_ENV"
fi
- name: "Install dependencies"
run: uv pip install --group ci
- name: "Run maturin"
run: maturin develop --features use-small-offset
- name: "Run pytest"
run: pytest -v -n auto
env:
HYPOTHESIS_PROFILE: slow