Skip to content

Improve CI: sanity checks, extract scripts, bump GHA actions#36

Merged
chezou merged 1 commit intomasterfrom
polish-ci
Mar 29, 2026
Merged

Improve CI: sanity checks, extract scripts, bump GHA actions#36
chezou merged 1 commit intomasterfrom
polish-ci

Conversation

@chezou
Copy link
Copy Markdown
Owner

@chezou chezou commented Mar 29, 2026

Summary

  • Extract CIBW_BEFORE_ALL_LINUX inline commands into linux-before-all.sh for readability
  • Add wheel sanity check (test-wheel.py) that runs tokenization after each wheel build on all platforms
  • Remove unused CIBW_BEFORE_ALL_MACOS no-op from YAML
  • Compact matrix using YAML flow-style entries (93 → 28 lines)
  • Bump GHA actions: checkout v4→v6, setup-python v5→v6, upload-artifact v4→v7, download-artifact v4→v8
  • Fix pre-existing bugs caught by sanity check:
    • Add swig to macOS brew dependencies (removed from runner image since 2024)
    • Run swig on Windows to generate Mykytea.py wrapper
    • Download KyTea model for Windows full tokenization test

Test plan

🤖 Generated with Claude Code

- Extract CIBW_BEFORE_ALL_LINUX into linux-before-all.sh for readability
- Remove unused CIBW_BEFORE_ALL_MACOS no-op
- Compact matrix with YAML flow-style entries
- Bump GHA actions (checkout v6, setup-python v6, upload-artifact v7,
  download-artifact v8) to fix Node.js 20 deprecation
- Add post-build wheel sanity check (test-wheel.py) that imports the
  C extension and runs tokenization on all platforms
- Fix pre-existing swig issues:
  - Add swig to macOS brew deps (removed from runner image in 2024)
  - Run swig on Windows to generate Mykytea.py wrapper
- Download KyTea model on Windows for full tokenization test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors and strengthens the wheel-build CI by extracting Linux “before all” logic into a script, adding a post-build wheel sanity test (import + tokenization) across platforms, and modernizing the GitHub Actions workflow configuration (including action version bumps and a compacted matrix).

Changes:

  • Extract Linux build prerequisites into .github/workflows/linux-before-all.sh and remove the unused macOS no-op hook.
  • Add .github/workflows/test-wheel.py and run it via cibuildwheel test commands (with a Windows model download to enable full tokenization).
  • Update GitHub Actions action major versions and compact the matrix entries.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/wheels.yml Compacts matrix, bumps actions, adds Windows prep (SWIG + model) and runs wheel sanity tests via cibuildwheel.
.github/workflows/test-wheel.py New wheel sanity test script validating import and tokenization.
.github/workflows/macos-build.sh Ensures swig is installed on macOS runners before building.
.github/workflows/linux-before-all.sh New extracted Linux dependency/build script for SWIG + KyTea + wrapper generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chezou chezou merged commit 5fe2274 into master Mar 29, 2026
26 checks passed
@chezou chezou deleted the polish-ci branch March 29, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants