Skip to Content
Welcome to RitoSwap's documentation!
CI / CDPipelinesDApp Pipeline

DApp Pipeline

The DApp pipeline runs on changes to the dapp or contracts workspaces and ships the mainnet and testnet deployments. It includes unit tests, smart contract tests, predeploy E2E validation, testnet smoke tests, rollback, and then mainnet deploy.

Triggers and change detection

TriggerDetails
push / pull_requestRuns on main for changes in dapp/**, colored-keys/**, or workflow/action files
workflow_dispatchManual run from GitHub Actions UI
paths-filterSets dapp and contracts flags for conditional jobs
⚠️

Workflow or action file changes trigger the workflow, but all jobs will skip because the paths filter only checks dapp/** and colored-keys/**. Use workflow_dispatch when testing CI changes.

Job flow

  1. Change detection: dorny/paths-filter marks whether dapp or contracts changed.
  2. ESLint: runs only when dapp changes or manual dispatch.
  3. Unit tests: Vitest with Codecov upload via OIDC.
  4. Hardhat tests: runs when contracts change or manual dispatch.
  5. Predeploy E2E: local build with Postgres service and Playwright smoke tests.
  6. Deploy testnet: prebuilt Vercel deploy (local build + vercel deploy —prebuilt).
  7. Smoke tests: Playwright E2E and Supertest API tests run in parallel against testnet.
  8. Rollback testnet: rolls back to previous production URL if smoke tests fail.
  9. Deploy mainnet: prebuilt Vercel deploy after testnet smoke tests pass.

Workflow Diagram

Deploy mode

  • Testnet and mainnet use mode: prebuilt in the vercel-deploy action.
  • Builds run from repo root; Vercel Root Directory must point at dapp for the DApp projects.

Coverage behavior

  • DApp unit tests upload coverage to Codecov when running in this pipeline.
  • Coverage reports are also uploaded as GitHub artifacts for every unit-test run.

Rollback behavior

Rollback is only enabled on testnet. Smoke tests on testnet are treated as a close approximation of mainnet behavior, and mainnet skips smoke tests because it targets live chains. The rollback flow can be added to mainnet if desired.

Required secrets and vars

NameTypeUsed for
VERCEL_TOKENSecretAll Vercel deploys
VERCEL_ORG_IDSecretAll Vercel deploys
VERCEL_PROJECT_IDSecretAll Vercel deploys
PRIVATE_KEY_PLAYWRIGHTSecretPlaywright smoke tests
PRIVATE_KEY_APISecretSupertest API smoke tests
TOKEN_IDSecretSupertest API smoke tests
TEST_BASE_URLVarBase URL for smoke tests (currently testnet)
CHAIN_IDVarSupertest chain ID
NEXT_PUBLIC_ENABLE_STATE_WORKERVarSupertest toggle for state worker
NEXT_PUBLIC_AI_CHAT_REQUIRES_JWTVarSupertest toggle for JWT requirements
Last updated on

RitoSwap Docs does not store, collect or access any of your conversations. All saved prompts are stored locally in your browser only.