CI/CD Pipeline¶
This page describes the CI/CD infrastructure for the ReScript IntelliJ Plugin.
Overview¶
The project uses GitHub Actions with 3 workflows:
Workflow |
File |
Trigger |
Purpose |
|---|---|---|---|
CI |
|
Push/PR to |
Build, test, lint, verify |
Release |
|
Tag |
Create GitHub Release |
Docs |
|
Push/PR to |
Build & deploy documentation |
Additionally, Dependabot is configured to automatically update Gradle and GitHub Actions dependencies on a weekly basis.
CI Workflow (ci.yml)¶
The main CI pipeline runs on every push to main and on pull requests targeting main.
Jobs¶
1. actionlint¶
Validates GitHub Actions workflow syntax using reviewdog. Fails on errors.
2. build¶
The primary build and test job:
Checkout → Validate Gradle Wrapper → Setup JDK 21 → Setup Gradle (with caching)
→ ktlint check → Build plugin → Run tests with coverage
→ Coverage report on PR → Verify plugin structure → Upload artifacts
Steps:
Step |
Command |
Purpose |
|---|---|---|
ktlint |
|
Enforce Kotlin code style |
Build |
|
Compile, generate lexer, package plugin |
Test |
|
Run tests and generate coverage reports |
Verify |
|
Check plugin descriptor and JAR structure |
Verify config |
|
Validate project configuration |
Artifacts uploaded:
plugin-zip— Plugin distribution ZIPtest-results— JUnit test reportscoverage-report— Kover HTML coverage report
PR-specific features:
Code coverage is reported as a PR comment via kover-report
Gradle caching is read-only on PRs (writable only on
mainpushes)
3. verify (push only)¶
Runs ./gradlew verifyPlugin for binary compatibility verification using IntelliJ Plugin Verifier. This checks the plugin against recommended IDE versions to detect API incompatibilities.
Release Workflow (release.yml)¶
Triggered when a git tag matching v*.*.* is pushed.
Release flow¶
Extract version from tag (e.g.,
v1.2.3→1.2.3)Validate Gradle wrapper
Run pre-release checks:
ktlintCheck test verifyPluginStructure verifyPluginBuild plugin
Create GitHub Release with auto-generated release notes
Attach plugin ZIP as release asset
Pre-release detection: tags containing
-(e.g.,v1.0.0-beta.1) are marked as pre-release
Creating a release¶
# Tag a release
git tag v1.0.0
git push origin v1.0.0
# Tag a pre-release
git tag v1.0.0-beta.1
git push origin v1.0.0-beta.1
Note
JetBrains Marketplace publishing is not yet automated. See the TODO in release.yml.
Documentation Workflow (docs.yml)¶
Triggered on push/PR to main when files in sphinx-docs/ change. Also supports manual dispatch.
Jobs¶
1. lint-and-test¶
Runs quality checks on the Sphinx documentation source:
Check |
Command |
Purpose |
|---|---|---|
Ruff lint |
|
Python linting |
Ruff format |
|
Python formatting |
Mypy |
|
Type checking |
Pytest |
|
Test custom extensions |
2. build¶
Builds the documentation site (English + Japanese) with Sphinx:
Runs
make build-allwhich builds both language versions and assembles the site with Pagefind searchOn PRs: runs link checking (
make linkcheck) and reports results to the Job SummaryOn push: uploads the built site as a GitHub Pages artifact
3. deploy (push only)¶
Deploys the built site to GitHub Pages using actions/deploy-pages@v4.
Local CI Reproduction¶
You can run the same checks locally that CI performs:
# Full CI check (matches the build job)
./gradlew ktlintCheck buildPlugin test koverXmlReport koverHtmlReport verifyPluginStructure verifyPluginProjectConfiguration
# Quick check (build + test only)
./gradlew buildPlugin test
# Individual checks
./gradlew ktlintCheck # Code style
./gradlew test # Unit & integration tests
./gradlew koverHtmlReport # Coverage report (open build/reports/kover/html/index.html)
./gradlew verifyPlugin # Binary compatibility (slow, runs on push only)
# Documentation checks (from sphinx-docs/ directory)
cd sphinx-docs
uv sync
make check # lint + typecheck + test
make html # Build English docs
make build-all # Build full site (EN + JA)
make serve # Serve locally at http://localhost:8000
Troubleshooting¶
Build failures¶
- “Could not resolve all files for configuration”
Gradle dependency resolution failure. Run
./gradlew --refresh-dependencies buildPluginto force re-download.- JFlex lexer generation fails
The
generateRescriptLexertask auto-runs before compilation. If it fails, checksrc/main/java/com/rescript/plugin/lang/Rescript.flexfor syntax errors. Run./gradlew generateRescriptLexerin isolation to see detailed errors.- ktlint check fails
Run
./gradlew ktlintFormatto auto-fix most issues, then commit the changes.
Test failures¶
- Tests pass locally but fail in CI
CI runs on Ubuntu with a headless JDK. Tests that depend on UI components (Swing) may behave differently. Use
BasePlatformTestCasefor IDE integration tests and avoid direct UI interactions.- “No display available” errors
The Gradle
runIdetask requires a display. In CI, this is handled automatically, but local headless testing may needDISPLAYset orXvfbrunning.
Coverage¶
- Coverage report is empty
Ensure tests actually run by checking
./gradlew testoutput. Kover reports are generated only if tests execute.- Coverage not appearing on PR
The
kover-reportaction requires the XML report atbuild/reports/kover/report.xml. Verify this file exists after running tests.
Documentation¶
- Sphinx build fails
Run
uv syncinsphinx-docs/to install dependencies. Ensure Python 3.12+ is available.- Link check failures on PR
Link checking is non-blocking (
continue-on-error: true). Review the Job Summary for broken links and fix them if they point to project pages.
Secrets¶
The following GitHub repository secrets are used:
Secret |
Workflow |
Purpose |
|---|---|---|
|
Release (TODO) |
Plugin publishing (not yet configured) |
Dependabot¶
Dependabot is configured in .github/dependabot.yml:
Gradle dependencies: Weekly updates on Mondays, up to 5 concurrent PRs
GitHub Actions: Weekly updates on Mondays, up to 5 concurrent PRs
All update PRs are labeled with
dependencies