Publication
Partagez vos connaissances.

# Building Robust Move + TypeScript Workflows đ ïžâš
Compiling, Testing, and Continuous Integration for Sui Developers Problem: You can write Move smart contracts and a TypeScript frontend, but getting them to work together in a clean, automated workflow is messy. You probably juggle between CLI commands, manual builds, and fragile test setups â which makes bugs slip into production. đ©
Goal: Build a deterministic pipeline where everything flows: âĄïž Compile Move packages â â Run Move unit tests â đ Run TypeScript integration tests â đ€ Automate in CI/CD.
This guide shows you how to set up a bulletproof workflow for Move + TypeScript projects on Sui.
1) Local build and test flow âĄ
Before you even think about CI, you need a reliable local loop:
- Move compilation
sui move build --path ./move
- Compiles your Move modules.
- Produces bytecode + ABI â which your frontend/SDK consumes.
- Run Move unit tests
sui move test --path ./move
- Executes
#[test]
functions in your Move modules. - Great for logic validation without deploying.
- Export artifacts for frontend
- Keep outputs in
build/
orartifacts/
. - Your TypeScript SDK should always reference ABI from this build (not a stale copy).
đ Local rule of thumb: Never commit frontend code pointing at an old ABI. Always recompile after Move changes.
2) TypeScript integration testing đ§âđ»
Once Move logic compiles, test it end-to-end with your frontend:
- Add a testing framework:
npm i --save-dev jest ts-jest @types/jest
(or use Mocha if you prefer).
- Connect to local devnet or a dockerized testnet:
- CI can spin this up.
- Local devnet ensures deterministic state.
- Example test (Jest):
import { JsonRpcProvider, devnetConnection } from "@mysten/sui.js";
const provider = new JsonRpcProvider(devnetConnection);
test("fetch coin objects", async () => {
const objects = await provider.getOwnedObjects({ owner: "0x123..." });
expect(objects.length).toBeGreaterThanOrEqual(0);
});
- Use fixture accounts:
- Pre-fund them with devnet faucet or seed via CLI.
- Keeps tests reproducible.
đĄ Tip: Write tests for both happy paths and error paths. Donât just test âsuccessâ â test insufficient gas, invalid ownership, etc.
3) CI Setup (GitHub Actions Example) đ€
Now letâs automate it! A minimal GitHub Actions pipeline:
name: CI
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install dependencies
run: npm ci
- name: Start Sui Devnet
run: sui start --background
- name: Build Move
run: sui move build --path ./move
- name: Run Move tests
run: sui move test --path ./move
- name: Run TS tests
run: npm test
â Steps:
- Install Node.js + Rust.
- Start local devnet.
- Build & test Move.
- Run TypeScript integration tests.
4) Determinism & caching âĄđ
CI should be fast and reliable. Speed it up with caching:
- Cache
node_modules
and Rust Cargo build artifacts. - Persist Move build artifacts between steps.
- Use GitHubâs built-in
actions/cache
for smarter caching.
đ This avoids re-downloading and rebuilding everything on each push.
5) Troubleshooting tips đ ïž
Even with CI, things can break. Hereâs a quick guide:
-
Node failing to start in CI â Bump resources, ensure ports arenât already used.
-
ABI mismatch â Always generate frontend ABI from exact
sui move build
used in deploy. Donât copy-paste. -
Flaky tests â Seed deterministic accounts, mock randomness where possible, isolate external dependencies.
-
Slow pipeline â Add caching layers, avoid reinstalling dependencies unnecessarily.
Final Thoughts đ
By following this flow, you get:
- Move logic tested in isolation â
- Frontend verified against real contracts đ
- Automated CI/CD that ensures every push is safe đŠ
The result? Confidence. Your contracts and dApps wonât break silently, and your team spends less time debugging âit works on my machineâ problems. đŻ
- SDKs and Developer Tools
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
Gagne ta part de 1000 Sui
Gagne des points de réputation et obtiens des récompenses pour avoir aidé la communauté Sui à se développer.

- Pourquoi BCS exige-t-il un ordre de champs exact pour la désérialisation alors que les structures Move ont des champs nommés ?65
- « Erreurs de vérification de sources multiples » dans les publications du module Sui Move - Résolution automatique des erreurs55
- Ăchec de la transaction Sui : objets rĂ©servĂ©s pour une autre transaction49
- Erreur Sui Move - Impossible de traiter la transaction Aucune piÚce de gaz valide n'a été trouvée pour la transaction315
- Comment maximiser la détention de profits SUI : Sui Staking contre Liquid Staking213