fix(ci): install the workspace before running simulations #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| economics: | |
| name: Economic simulation gate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # pnpm reads its version from `packageManager` in package.json. Passing a | |
| # `version` here as well makes the action refuse to guess between them. | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| # These simulations import each other by package name (@sent/stockback and | |
| # friends), so they need the workspace links even though they run no build. | |
| # They used to work without an install because they reached across | |
| # directories with relative paths — which is exactly the undeclared | |
| # dependency graph that refactor removed. | |
| - run: pnpm install --frozen-lockfile | |
| # Masterplan 9/10: the simulation is a mandatory validation gate. | |
| # A failure here is a BLOCKED escalation, never a tuning exercise. | |
| - name: Reproduce section 8 reference outcomes | |
| run: node --experimental-strip-types packages/economics/sim/reference.ts | |
| - name: Graduation V3 geometry proof | |
| run: node --experimental-strip-types packages/economics/sim/graduation-v3.ts | |
| - name: Stockback TWAB and conservation | |
| run: node --experimental-strip-types packages/stockback/sim/stockback.ts | |
| - name: TWAB edge cases | |
| run: node --experimental-strip-types packages/stockback/sim/twab-edges.ts | |
| - name: Market lifecycle economic gate | |
| run: node --experimental-strip-types packages/economics/sim/lifecycle.ts | |
| - name: Reorg handling | |
| run: node --experimental-strip-types services/indexer/sim/reorg.ts | |
| - name: Freshness contract | |
| run: node --experimental-strip-types packages/realtime/sim/freshness.ts | |
| - name: Attestor determinism | |
| run: node --experimental-strip-types services/stockback/sim/determinism.ts | |
| - name: Realtime gateway | |
| run: node --experimental-strip-types services/realtime/sim/gateway.ts | |
| - name: API handlers | |
| run: node --experimental-strip-types services/api/sim/handlers.ts | |
| # The differential fixtures are committed. If TypeScript changed without | |
| # regenerating them, or a regenerated set was not committed, this fails - | |
| # which is exactly the drift 1064 forbids. | |
| - name: Differential fixtures are current | |
| run: | | |
| node --experimental-strip-types packages/economics/sim/fixtures.ts | |
| node --experimental-strip-types packages/stockback/sim/merkle-fixtures.ts | |
| node --experimental-strip-types packages/sdk/sim/intent-fixtures.ts | |
| node --experimental-strip-types packages/economics/sim/v3-fixtures.ts | |
| git diff --exit-code contracts/test/fixtures/ | |
| workspace: | |
| name: Typecheck / lint / build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| # Strict mode with noUncheckedIndexedAccess and exactOptionalPropertyTypes. | |
| # This was not wired up until Day 4's audit, which is exactly the kind of | |
| # gap an audit is for. | |
| - run: pnpm typecheck | |
| contracts: | |
| name: Foundry | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Build | |
| run: forge build --root contracts | |
| # Informational only (D-008): every current hit is a test or a documented | |
| # design decision. Reviewed as part of the Day 6 quality pass. | |
| - name: Lint (non-blocking) | |
| run: forge lint --root contracts || true | |
| - name: Unit + fuzz | |
| run: forge test --root contracts -vvv | |
| - name: Invariants | |
| env: | |
| FOUNDRY_PROFILE: inv | |
| run: forge test --root contracts -vvv | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| # Replays the logs the Foundry run just captured through the production | |
| # reducer, proving the projection reproduces on-chain state (138). | |
| - name: Projection replay proof | |
| run: node --experimental-strip-types services/indexer/sim/projection.ts |