@@ -39,13 +39,17 @@ jobs:
39
39
40
40
- name : Build o1js
41
41
if : steps.cache.outputs.cache-hit != 'true'
42
+ shell : bash
42
43
run : |
44
+ #!/bin/bash
43
45
npm ci
44
46
npm run build
45
47
46
48
- name : Count tests
47
49
id : count_tests
50
+ shell : bash
48
51
run : |
52
+ #!/bin/bash
49
53
TEST_COUNT=$(find ./dist/node -name "*.unit-test.js" | wc -l)
50
54
echo "test_count=${TEST_COUNT}" >> "$GITHUB_OUTPUT"
51
55
echo "Total test count: ${TEST_COUNT}"
@@ -58,22 +62,26 @@ jobs:
58
62
59
63
Build-And-Test-Server :
60
64
needs : Prepare
61
- timeout-minutes : 210
65
+ # timeout-minutes: 210
62
66
runs-on : ubuntu-latest
63
67
strategy :
64
68
fail-fast : false
65
69
matrix :
66
- test_type :
67
- [
68
- ' Simple integration tests' ,
69
- ' Reducer integration tests' ,
70
- ' DEX integration tests' ,
71
- ' DEX integration test with proofs' ,
72
- ' Voting integration tests' ,
73
- ' Verification Key Regression Check 1' ,
74
- ' Verification Key Regression Check 2' ,
75
- ' CommonJS test' ,
76
- ]
70
+ # prof, heap, cpu,
71
+ perf : [ no, all]
72
+ node_version : [ 18,20,22 ]
73
+
74
+ test_type :
75
+ [
76
+ ' Simple integration tests' ,
77
+ ' Reducer integration tests' ,
78
+ ' DEX integration tests' ,
79
+ ' DEX integration test with proofs' ,
80
+ ' Voting integration tests' ,
81
+ ' Verification Key Regression Check 1' ,
82
+ ' Verification Key Regression Check 2' ,
83
+ ' CommonJS test' ,
84
+ ]
77
85
steps :
78
86
- name : Restore repository
79
87
uses : actions/cache@v4
@@ -96,23 +104,64 @@ jobs:
96
104
key : ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.js') }}
97
105
98
106
- name : Prepare for tests
99
- run : touch profiling.md
107
+ shell : bash
108
+ run : |
109
+ #!/bin/bash
110
+ touch profiling.md
111
+
112
+ - name : Sets MODIFIED_BRANCH_NAME
113
+ env :
114
+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
115
+ shell : bash
116
+ run : |
117
+ #!/bin/bash
118
+ MODIFIED_BRANCH_NAME=${BRANCH_NAME/\//-}
119
+ OUTPUT_DIR="profile/profile-data/${MODIFIED_BRANCH_NAME}"
120
+ OUTPUT_TEST_DIR="${OUTPUT_DIR}/profile-data-${{matrix.test_type}}-${{ matrix.perf }}-${{ matrix.node_version }}"
121
+
122
+ echo "MODIFIED_BRANCH_NAME=${MODIFIED_BRANCH_NAME}" >> "$GITHUB_ENV"
123
+ echo "OUTPUT_DIR=${OUTPUT_DIR}" >> "$GITHUB_ENV"
124
+ echo "OUTPUT_TEST_DIR=${OUTPUT_TEST_DIR}" >> "$GITHUB_ENV"
125
+
126
+ - name : create dir
127
+ shell : bash
128
+ run : |
129
+ #!/bin/bash
130
+ mkdir -p "${{env.OUTPUT_TEST_DIR}}"
100
131
101
132
- name : Execute tests
102
133
env :
103
134
TEST_TYPE : ${{ matrix.test_type }}
104
- run : sh run-ci-tests.sh
135
+ PERF_TYPE : ${{ matrix.perf }}
136
+ shell : bash
137
+ run : |
138
+ #!/bin/bash
139
+ sh run-ci-tests.sh || echo skip errors
140
+ mv isolate-*-v8.log "${OUTPUT_TEST_DIR}" || echo ok
141
+ mv Heap.*.heapprofile "${OUTPUT_TEST_DIR}" || echo ok
142
+ mv CPU.*.cpuprofile "${OUTPUT_TEST_DIR}" || echo ok
143
+ continue-on-error : true
144
+
145
+ - name : Upload test results
146
+ if : always()
147
+ uses : actions/upload-artifact@v4
148
+ with :
149
+ name : test-results-${{env.MODIFIED_BRANCH_NAME}}-${{ matrix.chunk }}-${{ matrix.perf }}-${{ matrix.node_version }}
150
+ path : ${{env.OUTPUT_TEST_DIR}}
151
+
105
152
106
153
- name : Add to job summary
107
154
if : always()
155
+ shell : bash
108
156
run : |
157
+ #!/bin/bash
109
158
echo "### Test Results for ${{ matrix.test_type }}" >> "$GITHUB_STEP_SUMMARY"
110
159
cat profiling.md >> "$GITHUB_STEP_SUMMARY"
111
160
112
161
Run-Unit-Tests :
113
162
needs : Prepare
114
163
name : Run unit tests parallel
115
- timeout-minutes : 60 # lets keep the individual jobs shorter
164
+ # timeout-minutes: 60 # lets keep the individual jobs shorter
116
165
runs-on : ubuntu-latest
117
166
strategy :
118
167
fail-fast : false
@@ -137,8 +186,7 @@ jobs:
137
186
138
187
- name : Setup Node
139
188
uses : actions/setup-node@v4
140
- with :
141
- # FIXME change to use matrix
189
+ with :
142
190
node-version : ${{ matrix.node_version }}
143
191
144
192
- name : Restore cache
@@ -151,16 +199,24 @@ jobs:
151
199
key : ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.js') }}
152
200
153
201
- name : Prepare for tests
154
- run : touch profiling.md
202
+ shell : bash
203
+ run : |
204
+ #!/bin/bash
205
+ touch profiling.md
155
206
- name : create dir
156
- run : mkdir -p profile/profile-data
207
+ shell : bash
208
+ run : |
209
+ #!/bin/bash
210
+ mkdir -p profile/profile-data
157
211
# - name: create dirs
158
212
159
213
# from https://stackoverflow.com/questions/75985925/how-to-replace-slashes-with-dashes-and-set-it-an-environment-variable-in-github
160
214
- name : Sets MODIFIED_BRANCH_NAME
161
215
env :
162
- BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
216
+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
217
+ shell : bash
163
218
run : |
219
+ #!/bin/bash
164
220
MODIFIED_BRANCH_NAME=${BRANCH_NAME/\//-}
165
221
OUTPUT_DIR="profile/profile-data/${MODIFIED_BRANCH_NAME}"
166
222
OUTPUT_TEST_DIR="${OUTPUT_DIR}/profile-data-${{matrix.chunk}}-${{ matrix.perf }}-${{ matrix.node_version }}"
@@ -170,15 +226,20 @@ jobs:
170
226
echo "OUTPUT_TEST_DIR=${OUTPUT_TEST_DIR}" >> "$GITHUB_ENV"
171
227
172
228
- name : create dir
173
- run : mkdir -p ${{env.OUTPUT_TEST_DIR}}
229
+ shell : bash
230
+ run : |
231
+ #!/bin/bash
232
+ mkdir -p "${{env.OUTPUT_TEST_DIR}}"
174
233
175
234
- name : Run unit tests
176
- timeout-minutes : 30
235
+ # timeout-minutes: 30
177
236
env :
178
237
TOTAL_TESTS : ${{ needs.Prepare.outputs.test_count }}
179
238
CHUNK : ${{ matrix.chunk }}
180
239
CHUNKS : 32
240
+ shell : bash
181
241
run : |
242
+ #!/bin/bash
182
243
echo "Total tests: $TOTAL_TESTS"
183
244
echo "Current chunk: $CHUNK"
184
245
echo "Total chunks: $CHUNKS"
@@ -228,7 +289,7 @@ jobs:
228
289
# ALL
229
290
if [ "${{ matrix.perf }}" == "all" ]; then
230
291
echo all prof
231
- (node --prof --heap-prof --cpu-prof --expose-gc --enable-source-maps "${test_files[$i]}" | tee -a profiling.md) || echo skip errors
292
+ (node "${test_files[$i]}" | tee -a profiling.md) || echo skip errors
232
293
233
294
fi
234
295
@@ -250,7 +311,9 @@ jobs:
250
311
251
312
- name : Add to job summary
252
313
if : always()
314
+ shell : bash
253
315
run : |
316
+ #!/bin/bash
254
317
echo "### Test Results for Unit Tests Chunk ${{ matrix.chunk }}" >> "$GITHUB_STEP_SUMMARY"
255
318
cat profiling.md >> "$GITHUB_STEP_SUMMARY"
256
319
@@ -259,11 +322,15 @@ jobs:
259
322
needs : [Run-Unit-Tests]
260
323
runs-on : ubuntu-latest
261
324
steps :
262
- - run : echo "All unit tests completed successfully"
325
+
326
+ - run : |
327
+ #!/bin/bash
328
+ echo "All unit tests completed successfully"
329
+ shell: bash
263
330
264
331
Build-And-Test-Web :
265
332
needs : Prepare
266
- timeout-minutes : 90
333
+ # timeout-minutes: 90
267
334
runs-on : ubuntu-latest
268
335
steps :
269
336
- name : Restore repository
@@ -292,15 +359,23 @@ jobs:
292
359
293
360
- name : Install Playwright browsers
294
361
if : steps.playwright-cache.outputs.cache-hit != 'true'
295
- run : npm run e2e:install
362
+ run : |
363
+ #!/bin/bash
364
+ npm run e2e:install
365
+ shell : bash
296
366
297
367
- name : Build o1js and prepare the web server
368
+ shell : bash
298
369
run : |
370
+ #!/bin/bash
299
371
npm run build:web
300
372
npm run e2e:prepare-server
301
373
302
374
- name : Execute E2E tests
303
- run : npm run test:e2e
375
+ shell : bash
376
+ run : |
377
+ #!/bin/bash
378
+ npm run test:e2e
304
379
- name : Upload E2E test artifacts
305
380
uses : actions/upload-artifact@v4
306
381
continue-on-error : true
@@ -314,7 +389,7 @@ jobs:
314
389
315
390
Release-on-NPM :
316
391
if : github.ref == 'refs/heads/main'
317
- timeout-minutes : 180
392
+ # timeout-minutes: 180
318
393
runs-on : ubuntu-latest
319
394
needs : [Build-And-Test-Server, Run-Unit-Tests, Build-And-Test-Web]
320
395
steps :
@@ -330,7 +405,9 @@ jobs:
330
405
node-version : ' 18'
331
406
332
407
- name : Build o1js
408
+ shell : bash
333
409
run : |
410
+ #!/bin/bash
334
411
npm ci
335
412
npm run prepublishOnly
336
413
@@ -344,7 +421,7 @@ jobs:
344
421
345
422
Release-mina-signer-on-NPM :
346
423
if : github.ref == 'refs/heads/main'
347
- timeout-minutes : 180
424
+ # timeout-minutes: 180
348
425
runs-on : ubuntu-latest
349
426
needs : [Build-And-Test-Server, Run-Unit-Tests, Build-And-Test-Web]
350
427
steps :
@@ -360,9 +437,11 @@ jobs:
360
437
node-version : ' 18'
361
438
362
439
- name : Build mina-signer
440
+ shell : bash
363
441
run : |
442
+ #!/bin/bash
364
443
npm ci
365
- cd src/mina-signer
444
+ cd src/mina-signer || exit
366
445
npm ci
367
446
npm run prepublishOnly
368
447
0 commit comments