-
Notifications
You must be signed in to change notification settings - Fork 10
257 lines (216 loc) · 8.72 KB
/
Copy pathintegration-tests.yml
File metadata and controls
257 lines (216 loc) · 8.72 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: Integration Tests
on:
push:
branches: [main, 'v[0-9]+.[0-9]+']
pull_request:
workflow_dispatch:
inputs:
node-version:
description: 'Node.js version'
required: true
type: choice
default: 'all'
options:
- 'all'
- '22'
- '24'
- '26'
jobs:
generate-node-version-matrix:
name: Generate Node Version Matrix
runs-on: ubuntu-latest
outputs:
node-versions: ${{ steps.set-node-versions.outputs.node-versions }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set Node versions
id: set-node-versions
run: |
if [ "${{ github.event.inputs.node-version }}" == "all" ] || [ -z "${{ github.event.inputs.node-version }}" ]; then
echo "node-versions=[22, 24, 26]" >> $GITHUB_OUTPUT
else
echo "node-versions=[${{ github.event.inputs.node-version }}]" >> $GITHUB_OUTPUT
fi
build:
name: Build Harper (Node.js v${{ matrix.node-version }})
needs: generate-node-version-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJSON(needs.generate-node-version-matrix.outputs.node-versions) }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}
package-manager-cache: false
- name: Install dependencies
run: npm install --ignore-scripts
- name: Build
run: npm run build || true # we currently have type errors so just ignore that
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: harper-build-artifacts-node-${{ matrix.node-version }}
path: |
dist/
static/
node_modules/
package.json
retention-days: 1
run-integration-tests:
name: Integration Tests ${{matrix.shard}}/4 (Node.js v${{ matrix.node-version }})
runs-on: ubuntu-latest
needs: [generate-node-version-matrix, build]
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJSON(needs.generate-node-version-matrix.outputs.node-versions) }}
shard: [1, 2, 3, 4]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}
package-manager-cache: false
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: harper-build-artifacts-node-${{ matrix.node-version }}
- name: Relink bin scripts
run: npm install --ignore-scripts
- name: Install harperdb@4 for legacy tests
run: |
mkdir -p /tmp/harperdb-legacy
npm install --ignore-scripts --prefix /tmp/harperdb-legacy harperdb@4
- name: Run Integration Test Shard ${{ matrix.shard }}
env:
HARPER_INTEGRATION_TEST_LOG_DIR: /tmp/harper-integration-test-logs
HARPER_LEGACY_VERSION_PATH: /tmp/harperdb-legacy/node_modules/harperdb
HARPER_INTEGRATION_TEST_INSTALL_SCRIPT: dist/bin/harper.js
# Slow runners (especially under shard contention) may need more than
# the default 60s to reach 'successfully started'.
HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS: 120000
run: |
npm run test:integration:all -- --shard=${{ matrix.shard }}/4
- name: Upload Harper server logs
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: harper-server-logs-node-${{ matrix.node-version }}-shard-${{ matrix.shard }}
path: /tmp/harper-integration-test-logs/
retention-days: 3
if-no-files-found: ignore
build-windows:
name: Build Harper (Windows, Node.js v24)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js 24
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
package-manager-cache: false
- name: Install dependencies
run: npm install --ignore-scripts
- name: Build
run: npm run build
continue-on-error: true # we currently have type errors so just ignore that
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: harper-build-artifacts-windows
path: |
dist/
static/
node_modules/
package.json
retention-days: 1
run-integration-tests-windows:
name: Integration Tests ${{matrix.shard}}/4 (Windows, Node.js v24)
runs-on: windows-latest
needs: [build-windows]
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js 24
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
package-manager-cache: false
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: harper-build-artifacts-windows
- name: Relink bin scripts
run: npm install --ignore-scripts
- name: Install harperdb@4 for legacy tests
run: npm install --ignore-scripts --prefix "${{ runner.temp }}/harperdb-legacy" harperdb@4
- name: Run Integration Test Shard ${{ matrix.shard }}
env:
HARPER_INTEGRATION_TEST_LOG_DIR: ${{ runner.temp }}/harper-integration-test-logs
HARPER_LEGACY_VERSION_PATH: ${{ runner.temp }}/harperdb-legacy/node_modules/harperdb
HARPER_INTEGRATION_TEST_INSTALL_SCRIPT: dist/bin/harper.js
# Windows runners are noticeably slower than the Linux pool — the
# default 60s startHarper timeout is not enough for the per-test
# install + start sequence (see CRL fail-closed-timeout suite).
HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS: 180000
run: npm run test:integration:all -- --shard=${{ matrix.shard }}/4
- name: Upload Harper server logs
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: harper-server-logs-windows-shard-${{ matrix.shard }}
path: ${{ runner.temp }}/harper-integration-test-logs/
retention-days: 3
if-no-files-found: ignore
run-integration-tests-bun:
name: Integration Tests ${{matrix.shard}}/4 (Bun)
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
package-manager-cache: false
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: harper-build-artifacts-node-24
- name: Relink bin scripts
run: npm install --ignore-scripts
- name: Run Integration Test Shard ${{ matrix.shard }}
env:
HARPER_INTEGRATION_TEST_LOG_DIR: /tmp/harper-integration-test-logs
HARPER_RUNTIME: bun
HARPER_INTEGRATION_TEST_INSTALL_SCRIPT: dist/bin/harper.js
run: |
npm run test:integration:all -- --shard=${{ matrix.shard }}/4
- name: Upload Harper server logs
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: harper-server-logs-bun-shard-${{ matrix.shard }}
path: /tmp/harper-integration-test-logs/
retention-days: 3
if-no-files-found: ignore