motoko-github-ci-workflow
Installation
SKILL.md
Motoko GitHub CI Workflow
What This Is
This skill provides a comprehensive playbook for adding or updating a GitHub Actions CI workflow for Motoko projects. It covers automated testing, benchmarking, code formatting, and building (canisters or examples) using mops, moc, prettier, icp-cli, and dfx. It is a perfect companion to the mops-package-maintenance skill.
For general information on GitHub Actions, refer to the GitHub Actions Documentation. For Motoko-specific examples, you can explore public repositories in the research-ag organization.
Prerequisites
mopsCLI (local:npm i -g ic-mops, CI:caffeinelabs/setup-mops@v1)node(latest LTS recommended, at least v22 for Prettier)pocket-icfor runningmops bench. As of mops CLI v3.0.0, dfx-replica support is gone — PocketIC is the only runtimemops bench(and replica tests /--check-deploy) can use, and it must be explicitly pinned via[toolchain] pocket-ic = "<version>"inmops.toml(e.g.mops toolchain use pocket-ic 15.0.0). Without that pin,mops bencherrors outright. CI installs the pinned binary viamops toolchain bin pocket-ic(see Step 1).wasm-optfor benchmarks that should reflect optimized (production-representative) Wasm.mops bench/mops buildonly run Binaryen'swasm-optwhenmops.tomlhas an[optimize]section — and that section requires an explicit[toolchain] wasm-opt = "<version>"pin, same aspocket-ic(see Step 1).