Skip to content

Commit ee8f69f

Browse files
authored
Merge pull request #13 from bug-ops/feature/cargo-make-migration
feat: migrate all scripts and CI tasks to cargo-make
2 parents 5ade586 + aba6c2d commit ee8f69f

File tree

7 files changed

+2196
-3015
lines changed

7 files changed

+2196
-3015
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,11 @@ jobs:
5050
shared-key: "lint"
5151
save-if: ${{ github.ref == 'refs/heads/main' }}
5252

53-
- name: Check formatting
54-
run: cargo +nightly fmt --all -- --check
53+
- name: Install cargo-make
54+
uses: taiki-e/install-action@cargo-make
5555

56-
- name: Clippy (workspace except Python bindings)
57-
run: cargo +stable clippy --all-targets --all-features --workspace --exclude feedparser-rs-py -- -D warnings
58-
59-
- name: Install SARIF tools
60-
run: cargo install clippy-sarif sarif-fmt
61-
62-
- name: Clippy SARIF (for GitHub PR annotations)
63-
run: |
64-
cargo clippy --all-targets --all-features --workspace \
65-
--exclude feedparser-rs-py --message-format=json -- -D warnings | \
66-
clippy-sarif | tee clippy-results.sarif | sarif-fmt
67-
continue-on-error: true
68-
69-
- name: Upload SARIF to GitHub
70-
uses: github/codeql-action/upload-sarif@v4
71-
with:
72-
sarif_file: clippy-results.sarif
73-
wait-for-processing: true
74-
75-
- name: Check documentation
76-
run: cargo doc --no-deps --all-features --workspace --exclude feedparser-rs-py
77-
env:
78-
RUSTDOCFLAGS: "-D warnings"
56+
- name: Run lint checks
57+
run: cargo make ci-lint
7958

8059
# Security audit
8160
security:
@@ -98,17 +77,8 @@ jobs:
9877
- name: Install cargo-deny
9978
uses: taiki-e/install-action@cargo-deny
10079

101-
- name: Scan for vulnerabilities
102-
run: cargo deny check advisories
103-
104-
- name: Check licenses
105-
run: cargo deny check licenses
106-
107-
- name: Check bans
108-
run: cargo deny check bans
109-
110-
- name: Check sources
111-
run: cargo deny check sources
80+
- name: Run cargo-deny
81+
run: cargo deny check
11282

11383
# Cross-platform Rust tests
11484
test-rust:
@@ -129,20 +99,17 @@ jobs:
12999
- name: Install Rust stable
130100
uses: dtolnay/rust-toolchain@stable
131101

132-
- name: Install nextest
133-
uses: taiki-e/install-action@nextest
134-
135102
- name: Cache Cargo
136103
uses: Swatinem/rust-cache@v2
137104
with:
138105
shared-key: "test-rust-${{ matrix.os }}"
139106
save-if: ${{ github.ref == 'refs/heads/main' }}
140107

141-
- name: Run tests
142-
run: cargo nextest run --all-features --no-fail-fast --workspace --exclude feedparser-rs-py
108+
- name: Install cargo-make
109+
uses: taiki-e/install-action@cargo-make
143110

144-
- name: Run doctests
145-
run: cargo test --doc --all-features --workspace --exclude feedparser-rs-py
111+
- name: Run Rust tests
112+
run: cargo make ci-test-rust
146113

147114
# Python bindings tests
148115
test-python:
@@ -193,25 +160,11 @@ jobs:
193160
- name: Install uv
194161
uses: astral-sh/setup-uv@v7
195162

196-
- name: Install maturin and pytest
197-
run: uv pip install --system maturin pytest
198-
199-
- name: Build Python wheel
200-
working-directory: crates/feedparser-rs-py
201-
run: maturin build --release --out dist
202-
203-
- name: Install wheel
204-
working-directory: crates/feedparser-rs-py
205-
shell: bash
206-
run: uv pip install --system dist/*.whl
163+
- name: Install cargo-make
164+
uses: taiki-e/install-action@cargo-make
207165

208166
- name: Run Python tests
209-
working-directory: crates/feedparser-rs-py
210-
run: pytest tests/ -v
211-
if: hashFiles('crates/feedparser-rs-py/tests/*.py') != ''
212-
213-
- name: Test Python import
214-
run: python -c "import feedparser_rs; print(f'feedparser-rs version loaded successfully')"
167+
run: cargo make ci-test-python
215168

216169
# Node.js bindings tests
217170
test-node:
@@ -244,24 +197,23 @@ jobs:
244197
save-if: ${{ github.ref == 'refs/heads/main' }}
245198
workspaces: crates/feedparser-rs-node
246199

200+
- name: Install pnpm
201+
uses: pnpm/action-setup@v4
202+
with:
203+
version: 9
204+
247205
- name: Setup Node.js ${{ matrix.node }}
248206
uses: actions/setup-node@v6
249207
with:
250208
node-version: ${{ matrix.node }}
251-
cache: 'npm'
252-
cache-dependency-path: crates/feedparser-rs-node/package-lock.json
209+
cache: 'pnpm'
210+
cache-dependency-path: crates/feedparser-rs-node/pnpm-lock.yaml
253211

254-
- name: Install dependencies
255-
working-directory: crates/feedparser-rs-node
256-
run: npm ci
212+
- name: Install cargo-make
213+
uses: taiki-e/install-action@cargo-make
257214

258-
- name: Build native module
259-
working-directory: crates/feedparser-rs-node
260-
run: npm run build
261-
262-
- name: Test
263-
working-directory: crates/feedparser-rs-node
264-
run: npm test
215+
- name: Run Node.js tests
216+
run: cargo make ci-test-node
265217

266218
# Rust code coverage
267219
coverage-rust:
@@ -285,16 +237,13 @@ jobs:
285237
shared-key: "coverage-rust"
286238
save-if: ${{ github.ref == 'refs/heads/main' }}
287239

288-
- name: Install nextest
289-
uses: taiki-e/install-action@nextest
290-
291-
- name: Install cargo-llvm-cov
292-
uses: taiki-e/install-action@cargo-llvm-cov
240+
- name: Install tools
241+
uses: taiki-e/install-action@v2
242+
with:
243+
tool: cargo-make,cargo-llvm-cov,cargo-nextest
293244

294-
- name: Generate coverage
295-
run: |
296-
cargo llvm-cov --all-features --workspace --exclude feedparser-rs-py \
297-
--lcov --output-path lcov.info nextest
245+
- name: Generate Rust coverage
246+
run: cargo make ci-coverage-rust
298247

299248
- name: Upload to codecov
300249
uses: codecov/codecov-action@v5
@@ -333,24 +282,12 @@ jobs:
333282
- name: Install uv
334283
uses: astral-sh/setup-uv@v7
335284

336-
- name: Install dependencies
337-
run: uv pip install --system maturin pytest pytest-cov
338-
339-
- name: Build Python wheel
340-
working-directory: crates/feedparser-rs-py
341-
run: maturin build --release --out dist
285+
- name: Install cargo-make
286+
uses: taiki-e/install-action@cargo-make
342287

343-
- name: Install wheel
344-
working-directory: crates/feedparser-rs-py
345-
shell: bash
346-
run: uv pip install --system dist/*.whl
347-
348-
- name: Run tests with coverage
349-
working-directory: crates/feedparser-rs-py
350-
run: |
351-
pytest tests/ --cov=feedparser_rs --cov-report=xml --cov-report=term
288+
- name: Generate Python coverage
289+
run: cargo make ci-coverage-python
352290
continue-on-error: true
353-
if: hashFiles('crates/feedparser-rs-py/tests/*.py') != ''
354291

355292
- name: Upload Python coverage to codecov
356293
uses: codecov/codecov-action@v5
@@ -381,24 +318,23 @@ jobs:
381318
shared-key: "coverage-node"
382319
workspaces: crates/feedparser-rs-node
383320

321+
- name: Install pnpm
322+
uses: pnpm/action-setup@v4
323+
with:
324+
version: 9
325+
384326
- name: Setup Node.js
385327
uses: actions/setup-node@v6
386328
with:
387329
node-version: '20'
388-
cache: 'npm'
389-
cache-dependency-path: crates/feedparser-rs-node/package-lock.json
390-
391-
- name: Install dependencies
392-
working-directory: crates/feedparser-rs-node
393-
run: npm ci
330+
cache: 'pnpm'
331+
cache-dependency-path: crates/feedparser-rs-node/pnpm-lock.yaml
394332

395-
- name: Build native module
396-
working-directory: crates/feedparser-rs-node
397-
run: npm run build
333+
- name: Install cargo-make
334+
uses: taiki-e/install-action@cargo-make
398335

399-
- name: Run tests with coverage
400-
working-directory: crates/feedparser-rs-node
401-
run: npm run test:coverage
336+
- name: Generate Node.js coverage
337+
run: cargo make ci-coverage-node
402338
continue-on-error: true
403339

404340
- name: Upload Node.js coverage to codecov
@@ -430,8 +366,11 @@ jobs:
430366
with:
431367
shared-key: "msrv"
432368

369+
- name: Install cargo-make
370+
uses: taiki-e/install-action@cargo-make
371+
433372
- name: Check with MSRV
434-
run: cargo +1.88.0 check --all-features --workspace --exclude feedparser-rs-py
373+
run: cargo make ci-msrv
435374

436375
# All checks passed gate
437376
ci-success:

0 commit comments

Comments
 (0)