-
Notifications
You must be signed in to change notification settings - Fork 6
130 lines (112 loc) · 3.46 KB
/
python.yml
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
name: Python
# spell-checker:ignore awalsh,CIBW,jakebailey,pkgs,pydata,pyproject
on:
push:
paths:
- .github/workflows/python.yml
- bindings/python/**
- pyproject.toml
- crates/**
- "!crates/oxidd-cli/**"
- Cargo.*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
lint-test-doc:
name: Lint, Test & Doc
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: cbindgen
version: 1.0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install tools & dependencies
run: python -m pip install --upgrade pip ruff sphinx pydata-sphinx-theme cibuildwheel pytest
- name: Build
run: python -m pip install .
- name: Ruff check
run: ruff check --output-format=github
- name: Ruff format check
run: ruff format --check
- uses: jakebailey/pyright-action@v2
- name: Test
run: pytest
- name: Sphinx
run: sphinx-build bindings/python/doc target/python/doc
- name: Deploy Docs
if: ${{ github.repository == 'OxiDD/oxidd' && github.ref == 'refs/heads/main' }}
working-directory: target/python/doc
run: |
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
ssh-agent sh -c "echo '$KEY' | ssh-add - && tar -cvz . | ssh -l '$USER' -p '$PORT' '$HOST' /extract-api.sh python dev"
env:
HOST: ${{ secrets.WEBSITE_SSH_HOST }}
USER: ${{ secrets.WEBSITE_SSH_USER }}
PORT: ${{ secrets.WEBSITE_SSH_PORT }}
KEY: ${{ secrets.WEBSITE_SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.WEBSITE_SSH_KNOWN_HOSTS }}
buildwheel-linux:
name: Build wheels for Linux
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: cbindgen
version: 1.0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install cibuildwheel
run: python3 -m pip install cibuildwheel
- name: Build (linux-buildwheel.py)
run: python3 bindings/python/build/linux-buildwheel.py --install-targets --archs all
- uses: actions/upload-artifact@v4
with:
name: python-wheels-linux
path: wheelhouse/*.whl
buildwheel-mac:
name: Build wheels for macOS
runs-on: ${{ matrix.os.image }}
strategy:
matrix:
os:
- { arch: x86_64, image: macos-13 }
- { arch: arm64, image: macos-14 }
steps:
- uses: actions/checkout@v4
- name: Install cbindgen
run: brew install cbindgen
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: native
- uses: actions/upload-artifact@v4
with:
name: python-wheels-mac-${{ matrix.os.arch }}
path: ./wheelhouse/*.whl
buildwheel-win:
name: Build wheels for Windows
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Install Rust targets
run: rustup target add aarch64-pc-windows-msvc
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_WINDOWS: all
CIBW_TEST_SKIP: "*-win_arm64"
- uses: actions/upload-artifact@v4
with:
name: python-wheels-win
path: ./wheelhouse/*.whl