feat(slippage): SSOT 7.3 fix — 4 DEX adapters + CLI + 17 regression tests #203
Workflow file for this run
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] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ts | |
| strategy: | |
| matrix: | |
| node-version: [20, 22, 24] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| cache-dependency-path: ts/pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check & build | |
| run: pnpm -r build | |
| - name: Lint | |
| run: pnpm -r lint | |
| - name: Unit tests | |
| # Failures must fail CI — `|| true` muted real regressions before. | |
| run: pnpm -r test | |
| - name: Package smoke test | |
| run: | | |
| cd packages/defi-cli | |
| pnpm pack | |
| TARBALL=$(ls hypurrquant-defi-cli-*.tgz) | |
| # Verify publish artifact contains expected files. v1.0.2 shipped a | |
| # stale config snapshot (only 2 chains); a smoke check on the | |
| # tarball would have caught it pre-publish. | |
| tar -tzf "$TARBALL" | grep -q 'package/dist/main.js' | |
| tar -tzf "$TARBALL" | grep -q 'package/dist/mcp-server.js' | |
| tar -tzf "$TARBALL" | grep -q 'package/config/chains.toml' | |
| # Sanity: chains.toml must list all 5 source chains. | |
| chain_count=$(tar -xzOf "$TARBALL" package/config/chains.toml | grep -cE '^\[chain\.(hyperevm|mantle|base|bnb|monad)\]') | |
| test "$chain_count" = "5" || (echo "Expected 5 source chains in shipped chains.toml, got $chain_count" && exit 1) | |
| # Install the tarball into a fresh dir and exercise both --version | |
| # and --help to confirm the bin entry resolves. | |
| mkdir -p /tmp/smoke-test | |
| cd /tmp/smoke-test | |
| npm init -y > /dev/null 2>&1 | |
| npm install "$GITHUB_WORKSPACE/ts/packages/defi-cli/$TARBALL" > /dev/null 2>&1 | |
| npx defi --version | |
| npx defi --help 2>&1 | grep -qE '[0-9]+ chains · [0-9]+ protocols' \ | |
| || (echo "Banner missing dynamic chain/protocol count" && exit 1) | |
| # Each source chain's status must return JSON with at least one | |
| # protocol — guards against v1.0.3-class stale-config regressions. | |
| for c in hyperevm mantle base bnb monad; do | |
| npx defi --json --chain $c status | grep -q '"slug":' \ | |
| || (echo "no protocols for $c — config likely stale" && exit 1) | |
| done | |
| release: | |
| name: GitHub Release | |
| needs: build-and-test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | |
| if [ -n "$PREV_TAG" ]; then | |
| LOG=$(git log --oneline "$PREV_TAG"..HEAD -- ':!.omc' ':!.github') | |
| else | |
| LOG=$(git log --oneline -20) | |
| fi | |
| echo "changelog<<EOF" >> "$GITHUB_OUTPUT" | |
| echo "$LOG" >> "$GITHUB_OUTPUT" | |
| echo "EOF" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| generate_release_notes: true | |
| body: | | |
| ## Changes | |
| ${{ steps.changelog.outputs.changelog }} | |
| **npm:** `npm install -g @hypurrquant/defi-cli@${{ github.ref_name }}` | |
| **npx:** `npx @hypurrquant/defi-cli --help` |