Skip to content

Conversation

@bikallem
Copy link
Owner

Summary

  • Fix GitHub Pages deployment by resolving target symlink (was causing MIME type errors) and add wasm-gc support with src/webapi.mjs
  • Add [js | wasm] links to examples index page
  • Merge pages.yml into ci.yml and fold examples job into build-test-webapi to eliminate duplicate runner setups
  • Add caching for npm, MoonBit packages (.mooncakes), and Playwright browsers
  • Bump moonbitlang/async to 0.16.6

Test plan

  • CI passes (check, test, examples build, Playwright)
  • Pages deploy succeeds on merge to main
  • JS examples load correctly on GitHub Pages
  • Wasm examples load correctly on GitHub Pages
  • Cache hits on subsequent runs

🤖 Generated with Claude Code

bikallem and others added 4 commits February 10, 2026 11:33
The target/ symlink to _build/ wasn't preserved by upload-pages-artifact,
causing JS module MIME type errors. Build a _site/ directory with resolved
symlinks, both JS and wasm-gc targets, and src/webapi.mjs for wasm imports.
Also add [js | wasm] links to the examples index.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eliminate duplicate runner setups by merging the Pages deployment workflow
into CI and folding the examples job into build-test-webapi. Pages steps
run conditionally on push to main only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 10, 2026 11:33
Copy link

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 updates CI and Pages deployment for the MoonBit WebAPI repo by consolidating workflows, adding caching, and improving the GitHub Pages artifact layout so the examples site can deploy reliably (including wasm-gc builds).

Changes:

  • Consolidates Pages deployment into the main CI workflow and adds caching for npm, MoonBit packages, and Playwright browsers.
  • Adjusts Pages site preparation to publish examples plus src/webapi.mjs, and adds wasm links to the examples index page.
  • Bumps moonbitlang/async dependency version in the root MoonBit module.

Reviewed changes

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

File Description
moon.mod.json Bumps moonbitlang/async version.
examples/index.html Updates examples landing page layout and adds per-example target links (js/wasm).
.github/workflows/pages.yml Removes standalone Pages workflow (merged into CI).
.github/workflows/ci.yml Consolidates build/test/examples/pages deploy into one workflow and adds caching + deployment steps.

Comment on lines +10 to +13
permissions:
contents: read
pages: write
id-token: write
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Workflow-level permissions grant pages: write and id-token: write on all events including pull_request. Even though the deploy job is gated, this still broadens the GITHUB_TOKEN for PR jobs; prefer setting minimal default permissions (e.g., contents: read) and granting pages/id-token only on the deploy/upload steps or jobs that need it.

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +17
concurrency:
group: "pages"
cancel-in-progress: false
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

concurrency: group: "pages" is applied at the workflow level, which will serialize all CI runs (including PR checks) behind the Pages deployment queue. If the intent is only to prevent concurrent deployments, move the concurrency block to the deploy job (or make the group conditional on push/main) so PR CI runs can execute in parallel.

Copilot uses AI. Check for mistakes.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mkdir -p _site/src
cp -rL examples _site/examples
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

cp -rL examples _site/examples will dereference any symlinks (including the examples/target -> ../target link mentioned in the PR description) and copy the entire linked directory into the Pages artifact. This can significantly bloat the uploaded site if ../target contains build outputs beyond what the examples need; consider copying only the required target/**/build/** subpaths (or ensuring the examples target output is isolated under examples/target) to keep Pages artifacts small and deployments faster.

Suggested change
cp -rL examples _site/examples
cp -r examples _site/examples

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bikallem bikallem closed this Feb 10, 2026
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.

1 participant