Skip to content

chore: Add vscode config for TS version (#1524) #1285

chore: Add vscode config for TS version (#1524)

chore: Add vscode config for TS version (#1524) #1285

name: Test sdk with multiple zod versions
on:
pull_request:
paths:
- "js/**"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- ".github/workflows/test-zod-versions.yaml"
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
actions: write
jobs:
test-zod-versions:
name: Test with zod ${{ matrix.zod-version }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
zod-version: ["3.25.34", "4.2.1"]
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY}}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY}}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Zod version
working-directory: ./js
run: |
pnpm add -D zod@${{ matrix.zod-version }}
- name: Run regular tests
shell: bash
run: make js-test
- name: Run zod v3 tests
if: matrix.zod-version == '3.25.34'
working-directory: ./js
run: |
pnpm test:zod-v3
- name: Run zod v4 tests
if: matrix.zod-version == '4.2.1'
working-directory: ./js
run: |
pnpm test:zod-v4
test-summary:
name: Test Summary
needs: test-zod-versions
runs-on: ubuntu-latest
timeout-minutes: 5
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.test-zod-versions.result }}" != "success" ]; then
echo "❌ Tests failed with one or more Zod versions"
exit 1
else
echo "✅ All tests passed with both Zod 3.x and 4.x"
fi