-
Notifications
You must be signed in to change notification settings - Fork 12
81 lines (69 loc) · 1.84 KB
/
Copy pathtest-zod-versions.yaml
File metadata and controls
81 lines (69 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Test sdk with multiple zod versions
on:
pull_request:
paths:
- "**"
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
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
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