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

  • mops CLI (local: npm i -g ic-mops, CI: caffeinelabs/setup-mops@v1)
  • node (latest LTS recommended, at least v22 for Prettier)
  • pocket-ic for running mops bench. As of mops CLI v3.0.0, dfx-replica support is gone — PocketIC is the only runtime mops bench (and replica tests / --check-deploy) can use, and it must be explicitly pinned via [toolchain] pocket-ic = "<version>" in mops.toml (e.g. mops toolchain use pocket-ic 15.0.0). Without that pin, mops bench errors outright. CI installs the pinned binary via mops toolchain bin pocket-ic (see Step 1).
  • wasm-opt for benchmarks that should reflect optimized (production-representative) Wasm. mops bench/mops build only run Binaryen's wasm-opt when mops.toml has an [optimize] section — and that section requires an explicit [toolchain] wasm-opt = "<version>" pin, same as pocket-ic (see Step 1).

How It Works

Installs
35
First Seen
May 7, 2026
motoko-github-ci-workflow — research-ag/motoko-skills