TS SDK Latest Compatibility #64
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: TS SDK Latest Compatibility | |
| on: | |
| schedule: | |
| # Every day at 02:00 UTC | |
| - cron: "0 2 * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ts-sdk-latest-compatibility-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CI: true | |
| jobs: | |
| build-and-test-with-latest-ts-sdk: | |
| name: Build and Test with latest @aptos-labs/ts-sdk | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js (LTS) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| - name: Setup pnpm 10.11.0 | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.11.0 | |
| run_install: false | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Upgrade @aptos-labs/ts-sdk to latest across workspace | |
| run: pnpm -r up @aptos-labs/ts-sdk@latest | |
| - name: Show resolved @aptos-labs/ts-sdk versions | |
| run: pnpm -r list @aptos-labs/ts-sdk --depth 0 | |
| - name: Ensure lockfile has only latest @aptos-labs/ts-sdk | |
| run: | | |
| LATEST="$(pnpm view @aptos-labs/ts-sdk version)" | |
| echo "Latest @aptos-labs/ts-sdk: ${LATEST}" | |
| export LATEST | |
| node -e "const fs=require('fs');const latest=process.env.LATEST;const lock=fs.readFileSync('pnpm-lock.yaml','utf8');const matches=[...lock.matchAll(/'@aptos-labs\\/ts-sdk@([^']+)'/g)];const versions=[...new Set(matches.map((m)=>m[1].split('(')[0]))].sort();console.log('Resolved versions:',versions.join(', ')||'(none)');const old=versions.filter((v)=>v!==latest);if(old.length){console.error('Found non-latest versions:',old.join(', '));process.exit(1);}" | |
| - name: Build all packages | |
| run: pnpm build | |
| - name: Run all tests | |
| run: pnpm test |