@@ -8,14 +8,83 @@ permissions:
88 contents : write
99 id-token : write
1010
11+ env :
12+ PROJECT_NAME : typeid-python
13+
1114jobs :
1215 test :
13- uses : ./.github/workflows/test.yml
16+ runs-on : ubuntu-latest
17+ strategy :
18+ fail-fast : false
19+ matrix :
20+ python-version : ["3.10", "3.11", "3.12", "3.13", "3.14"]
21+
22+ steps :
23+ - name : Checkout
24+ uses : actions/checkout@v4
25+ with :
26+ fetch-depth : 9
27+ submodules : false
28+
29+ - name : Set up Python ${{ matrix.python-version }}
30+ uses : actions/setup-python@v5
31+ with :
32+ python-version : ${{ matrix.python-version }}
33+
34+ - name : Install uv
35+ uses : astral-sh/setup-uv@v3
36+
37+ - name : Sync dependencies (locked)
38+ run : |
39+ uv sync --locked --all-groups
40+
41+ - name : Run tests
42+ run : |
43+ make test
44+
45+ - name : Run linters
46+ run : |
47+ make check-linting
48+
49+ test-native :
50+ name : Build + import native extension (${{ matrix.os }}, py${{ matrix.python-version }})
51+ runs-on : ${{ matrix.os }}
52+ needs :
53+ - test
54+ strategy :
55+ fail-fast : false
56+ matrix :
57+ os : [ubuntu-latest, macos-latest, windows-latest]
58+ python-version : ["3.11"]
59+
60+ steps :
61+ - name : Checkout
62+ uses : actions/checkout@v4
63+
64+ - name : Set up Python ${{ matrix.python-version }}
65+ uses : actions/setup-python@v5
66+ with :
67+ python-version : ${{ matrix.python-version }}
68+
69+ - name : Install Rust
70+ uses : dtolnay/rust-toolchain@stable
71+
72+ # Build & install the package in-place with the extension
73+ - name : Build & install (maturin develop)
74+ uses : PyO3/maturin-action@v1
75+ with :
76+ command : develop
77+ args : --release
78+
79+ - name : Sanity check (import extension)
80+ run : |
81+ python -c "import typeid; import typeid._base32; print('native ext OK')"
82+
1483
1584 build-wheels :
16- name : Build wheels (${{ matrix.os }})
85+ name : Build wheels (${{ matrix.os }}, py${{ matrix.python-version }} )
1786 runs-on : ${{ matrix.os }}
18- needs : test
87+ needs : test-native
1988 strategy :
2089 fail-fast : false
2190 matrix :
@@ -36,10 +105,8 @@ jobs:
36105 - name : Install Rust
37106 uses : dtolnay/rust-toolchain@stable
38107
39- - name : Install uv
40- uses : astral-sh/setup-uv@v3
41-
42- - name : Build wheels (Rust-enabled)
108+ # Build typeid-python wheel (includes rust extension)
109+ - name : Build wheels (maturin)
43110 uses : PyO3/maturin-action@v1
44111 with :
45112 command : build
51118 uses : actions/upload-artifact@v4
52119 with :
53120 name : wheels-${{ matrix.os }}-py${{ matrix.python-version }}
54- path : rust-base32/ dist/*.whl
121+ path : dist/*.whl
55122
56123 build-sdist :
57124 runs-on : ubuntu-latest
@@ -67,49 +134,25 @@ jobs:
67134 with :
68135 python-version : " 3.11"
69136
70- - name : Install uv
71- uses : astral-sh/setup-uv@v3
72-
73- - name : Sync deps (including build tools)
74- run : |
75- uv sync --all-extras --dev
76-
77- - name : Build sdist
78- run : |
79- make build-sdist
137+ - name : Install Rust
138+ uses : dtolnay/rust-toolchain@stable
80139
81- - name : Upload sdist
82- uses : actions/upload-artifact@v4
83- with :
84- name : sdist
85- path : dist/*.tar.gz
86-
87- build-rust-sdist :
88- runs-on : ubuntu-latest
89- needs : test
90- steps :
91- - uses : actions/checkout@v4
92- - uses : actions/setup-python@v5
93- with :
94- python-version : " 3.11"
95- - uses : dtolnay/rust-toolchain@stable
96- - name : Build rust sdist
140+ # Build typeid-python sdist (maturin)
141+ - name : Build sdist (maturin)
97142 uses : PyO3/maturin-action@v1
98143 with :
99144 command : sdist
100145 args : --out dist
101- working-directory : rust-base32
102146
103- - uses : actions/upload-artifact@v4
147+ - name : Upload sdist
148+ uses : actions/upload-artifact@v4
104149 with :
105- name : rust- sdist
106- path : rust-base32/ dist/*.tar.gz
150+ name : sdist
151+ path : dist/*.tar.gz
107152
108153 publish-package :
109154 runs-on : ubuntu-latest
110- needs :
111- - build-sdist
112- - build-rust-sdist
155+ needs : build-sdist
113156 permissions :
114157 contents : read
115158 id-token : write
@@ -149,4 +192,4 @@ jobs:
149192 uv sync --locked --all-groups
150193
151194 - name : Deploy to Pages
152- run : uv run mkdocs gh-deploy --force
195+ run : uv run mkdocs gh-deploy --force
0 commit comments