forked from VoltAgent/voltagent
-
Notifications
You must be signed in to change notification settings - Fork 1
191 lines (181 loc) · 5.5 KB
/
Copy pathpull-request.yml
File metadata and controls
191 lines (181 loc) · 5.5 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: PR Checks
on: [pull_request]
jobs:
commit-lint:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-commit-lint
cancel-in-progress: true
name: Commitlint
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v5
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22, 24]
concurrency:
group: ${{ github.ref }}-lint-${{ matrix.node-version }}
cancel-in-progress: true
name: Lint (Node ${{ matrix.node-version }})
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install Dependencies
run: |
pnpm install -w
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Lint with Biome
run: |
pnpm lint:ci
- name: Syncpack
run: pnpm sp lint
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22, 24]
concurrency:
group: ${{ github.ref }}-pr-build-${{ matrix.node-version }}
cancel-in-progress: true
name: Build (Node ${{ matrix.node-version }})
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install
run: pnpm install
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Build
run: pnpm build:all
- name: Publint
run: pnpm publint:all
- name: Are The Types Wrong
run: pnpm attw:all
test-packages:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- cli
- core
- create-voltagent-app
- docs-mcp
- internal
- langfuse-exporter
- logger
- postgres
- sdk
- supabase
- vercel-ai
- vercel-ai-exporter
- voice
- xsai
fail-fast: false
concurrency:
group: ${{ github.ref }}-test-${{ matrix.package }}
cancel-in-progress: true
name: Test ${{ matrix.package }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Set package scope
id: scope
run: |
if [[ "${{ matrix.package }}" == "create-voltagent-app" ]]; then
echo "scope=create-voltagent-app" >> $GITHUB_OUTPUT
else
echo "scope=@voltagent/${{ matrix.package }}" >> $GITHUB_OUTPUT
fi
- name: Build Package and Dependencies
run: lerna run build --scope "${{ steps.scope.outputs.scope }}" --include-dependencies
- name: Test Package
run: lerna run test --scope "${{ steps.scope.outputs.scope }}"
postgres-integration:
runs-on: ubuntu-latest
name: PostgreSQL Integration Tests
concurrency:
group: ${{ github.ref }}-postgres-integration
cancel-in-progress: true
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: voltagent_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for PostgreSQL changes
id: check_postgres
run: |
if git diff --name-only origin/main...HEAD | grep -E '^packages/postgres/'; then
echo "postgres_changed=true" >> $GITHUB_OUTPUT
else
echo "postgres_changed=false" >> $GITHUB_OUTPUT
fi
- name: Skip if no PostgreSQL changes
if: steps.check_postgres.outputs.postgres_changed == 'false'
run: echo "No PostgreSQL changes detected, skipping integration tests"
- uses: pnpm/action-setup@v4
if: steps.check_postgres.outputs.postgres_changed == 'true'
- uses: actions/setup-node@v4
if: steps.check_postgres.outputs.postgres_changed == 'true'
with:
node-version: 20
cache: "pnpm"
- name: Install Dependencies
if: steps.check_postgres.outputs.postgres_changed == 'true'
run: pnpm install
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Build Core Dependencies
if: steps.check_postgres.outputs.postgres_changed == 'true'
run: pnpm build --scope @voltagent/core
- name: Run PostgreSQL Integration Tests
if: steps.check_postgres.outputs.postgres_changed == 'true'
run: |
cd packages/postgres
npm run test:integration:ci
env:
DATABASE_URL: postgresql://test:test@localhost:5432/voltagent_test
tsdoc-check:
runs-on: ubuntu-latest
name: Check TSDoc Links
concurrency:
group: ${{ github.ref }}-tsdoc-check
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Check TSDoc Links
run: npx tsdoc-link-check --patterns packages/**