@@ -24,7 +24,7 @@ concurrency:
2424 cancel-in-progress : true
2525
2626jobs :
27- # Rust unit tests and linting
27+ # Rust unit tests and linting (all plugins in one job per OS)
2828 rust-tests :
2929 if : github.event_name != 'pull_request' || !github.event.pull_request.draft
3030 name : Rust Tests (${{ matrix.os }})
3434 fail-fast : false
3535 matrix :
3636 os : ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]') }}
37- rust : [stable]
3837
3938 steps :
4039 - uses : actions/checkout@v4
@@ -60,26 +59,17 @@ jobs:
6059 - name : Cache Cargo build
6160 uses : actions/cache@v4
6261 with :
63- path : plugins_rust/target
62+ path : plugins_rust/*/ target
6463 key : ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
6564
66- - name : Check formatting
67- working-directory : plugins_rust
68- run : make fmt -check
65+ # rust-check = fmt-check + clippy + cargo test only
66+ - name : Run all checks for plugins
67+ run : make rust -check
6968
70- - name : Run Clippy
71- working-directory : plugins_rust
72- run : make clippy
73-
74- - name : Run Rust tests
75- working-directory : plugins_rust
76- run : make test-verbose
77-
78-
79- # Build wheels for multiple platforms (native builds)
69+ # Build wheels for multiple platforms (all plugins in one job per OS)
8070 build-wheels :
8171 if : github.event_name != 'pull_request' || !github.event.pull_request.draft
82- name : Build wheels on ${{ matrix.os }}
72+ name : Build wheels ( ${{ matrix.os }})
8373 runs-on : ${{ matrix.os }}
8474 timeout-minutes : 60
8575 strategy :
@@ -98,75 +88,46 @@ jobs:
9888 - name : Install Rust stable
9989 run : rustup default stable
10090
101- - name : Install maturin
102- run : pip install maturin
91+ - name : Install uv
92+ uses : astral-sh/setup-uv@v5
93+ with :
94+ version : " 0.9.2"
95+
96+ - name : Install maturin as CLI tool
97+ run : uv tool install maturin
10398
104- - name : Build wheels
105- working-directory : plugins_rust
106- run : maturin build --release --out dist
99+ - name : Build wheels for all plugins
100+ run : make rust-build-wheels
107101
108102 - name : Upload wheels as artifacts
109103 uses : actions/upload-artifact@v4
110104 with :
111- name : wheels-${{ matrix.os }}
112- path : plugins_rust/dist/*.whl
105+ name : wheels-build
106+ path : plugins_rust/*/ dist/*.whl
113107
114-
115- # Python integration tests with Rust extensions
116- python-integration :
108+ # Security audit (all plugins in one job)
109+ security-audit :
117110 if : github.event_name != 'pull_request' || !github.event.pull_request.draft
118- name : Python Integration Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
119- runs-on : ${{ matrix.os }}
111+ name : Security Audit
112+ runs-on : ubuntu-latest
120113 timeout-minutes : 60
121- needs : build-wheels
122- strategy :
123- fail-fast : false
124- matrix :
125- os : ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]') }}
126- python-version : ["3.12"]
127114
128115 steps :
129116 - uses : actions/checkout@v4
130117
131- - name : Set up Python ${{ matrix.python-version }}
132- uses : actions/setup-python@v5
133- with :
134- python-version : ${{ matrix.python-version }}
135-
136118 - name : Install Rust stable
137119 run : rustup default stable
138120
139- - name : Install uv
140- uses : astral-sh/setup-uv@v5
141- with :
142- version : " 0.9.2"
143-
144- - name : Install maturin as CLI tool
145- run : uv tool install maturin
146-
147- - name : Create virtual environment
148- run : uv venv
149-
150- - name : Install dependencies
151- run : |
152- uv pip install pytest pytest-cov pydantic
153-
154- - name : Build and install Rust extension
155- working-directory : plugins_rust
156- run : make dev
157-
158- - name : Run Python unit tests (Rust)
159- working-directory : plugins_rust
160- run : uv run make test-python
121+ - name : Install cargo-audit
122+ run : cargo install cargo-audit
161123
162- - name : Run differential tests
163- working-directory : plugins_rust
164- run : uv run make test-differential
124+ - name : Run security audit on all plugins
125+ run : make rust-audit
165126
166- # Security audit
167- security-audit :
127+ # Benchmark tests (verify benchmarks compile and run)
128+ benchmark-tests :
168129 if : github.event_name != 'pull_request' || !github.event.pull_request.draft
169- name : Security Audit
130+ name : Benchmark Tests
170131 runs-on : ubuntu-latest
171132 timeout-minutes : 60
172133
@@ -176,14 +137,28 @@ jobs:
176137 - name : Install Rust stable
177138 run : rustup default stable
178139
179- - name : Install cargo-audit
180- run : cargo install cargo-audit
140+ - name : Cache Cargo registry
141+ uses : actions/cache@v4
142+ with :
143+ path : ~/.cargo/registry
144+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
145+
146+ - name : Cache Cargo index
147+ uses : actions/cache@v4
148+ with :
149+ path : ~/.cargo/git
150+ key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
151+
152+ - name : Cache Cargo build
153+ uses : actions/cache@v4
154+ with :
155+ path : plugins_rust/*/target
156+ key : ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }}
181157
182- - name : Run security audit
183- working-directory : plugins_rust
184- run : make audit
158+ - name : Run benchmarks for all plugins
159+ run : make rust-bench
185160
186- # Coverage report
161+ # Coverage report (all plugins in one job)
187162 coverage :
188163 if : github.event_name != 'pull_request' || !github.event.pull_request.draft
189164 name : Code Coverage
@@ -217,24 +192,19 @@ jobs:
217192 - name : Install coverage tools
218193 run : |
219194 uv pip install pytest pytest-cov pydantic
220- cargo install cargo-tarpaulin
195+ cargo install cargo-llvm-cov
221196
222- - name : Build Rust extension
223- working-directory : plugins_rust
224- run : make dev
225-
226- - name : Run coverage
227- working-directory : plugins_rust
228- run : uv run make coverage
197+ - name : Run coverage for all plugins
198+ run : make rust-coverage
229199
230200 - name : Upload coverage to Codecov
231201 uses : codecov/codecov-action@v4
232202 with :
233- files : ./plugins_rust/coverage/cobertura.xml
234- flags : rust
235- name : rust-coverage
203+ files : ./plugins_rust/*/ coverage/cobertura.xml
204+ flags : rust-plugins
205+ name : rust-plugins- coverage
236206
237- # Build documentation
207+ # Build documentation (all plugins in one job)
238208 documentation :
239209 if : github.event_name != 'pull_request' || !github.event.pull_request.draft
240210 name : Build Documentation
@@ -247,24 +217,24 @@ jobs:
247217 - name : Install Rust stable
248218 run : rustup default stable
249219
250- - name : Build Rust docs
251- working-directory : plugins_rust
252- run : make doc
220+ - name : Build Rust docs for all plugins
221+ run : make rust-doc
253222
254223 - name : Upload documentation
255224 uses : actions/upload-artifact@v4
256225 with :
257226 name : rust-docs
258- path : plugins_rust/target/doc
227+ path : plugins_rust/*/ target/doc
259228
260- # Release build (only on tags)
229+ # Release build (only on tags, all plugins per OS )
261230 release :
262- name : Release Build
231+ name : Release Build (${{ matrix.os }})
263232 runs-on : ${{ matrix.os }}
264233 timeout-minutes : 60
265234 if : startsWith(github.ref, 'refs/tags/')
266- needs : [ rust-tests, python-integration]
235+ needs : rust-tests
267236 strategy :
237+ fail-fast : false
268238 matrix :
269239 os : [ubuntu-latest, macos-latest, windows-latest]
270240
@@ -279,22 +249,25 @@ jobs:
279249 - name : Install Rust stable
280250 run : rustup default stable
281251
282- - name : Install maturin
283- run : pip install maturin
252+ - name : Install uv
253+ uses : astral-sh/setup-uv@v5
254+ with :
255+ version : " 0.9.2"
256+
257+ - name : Install maturin as CLI tool
258+ run : uv tool install maturin
284259
285- - name : Build release wheels
286- working-directory : plugins_rust
287- run : maturin build --release --out dist
260+ - name : Build and publish release wheels
261+ env :
262+ MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
263+ run : |
264+ make rust-release
265+ if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
266+ make rust-release-publish
267+ fi
288268
289269 - name : Upload release artifacts
290270 uses : actions/upload-artifact@v4
291271 with :
292272 name : release-wheels-${{ matrix.os }}
293- path : plugins_rust/dist/*.whl
294-
295- - name : Publish to PyPI (if tag)
296- if : startsWith(github.ref, 'refs/tags/')
297- env :
298- MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
299- working-directory : plugins_rust
300- run : maturin publish --username __token__ --password $MATURIN_PYPI_TOKEN
273+ path : plugins_rust/*/dist/*.whl
0 commit comments