Repository navigation
60 lines (60 loc) · 1.91 KB
/
Copy pathpython.yml
File metadata and controls
60 lines (60 loc) · 1.91 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
name: Python CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: python-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
native-wheel:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: python -m pip install "maturin>=1.9,<2" "pytest>=8,<9" "numpy>=1.24,<3"
- run: maturin build --release --locked --out dist
- name: Install built wheel
run: |
python - <<'PY'
import glob
import subprocess
import sys
subprocess.check_call([sys.executable, "-m", "pip", "install", *[wheel + "[datasets,tournaments]" for wheel in glob.glob("dist/*.whl")]])
PY
- run: python .github/scripts/check-position-sets.py
env:
POSITION_BASE_SHA: ${{ github.event.pull_request.base.sha }}
- run: python -m pytest python/tests -q
- name: Build local server for remote SDK integration
if: runner.os == 'Linux'
env:
SQLX_OFFLINE: true
run: cargo build -p gfa-cli --locked
- name: Compare remote and native SDK against real server
if: runner.os == 'Linux'
run: python .github/scripts/python-remote-smoke.py
- run: python examples/vector_throughput.py --output vector-benchmark.json
- uses: actions/upload-artifact@v4
with:
name: vector-throughput-${{ matrix.os }}
path: vector-benchmark.json
- uses: actions/upload-artifact@v4
with:
name: gamesforai-wheel-${{ matrix.os }}
path: dist/*.whl