-
Notifications
You must be signed in to change notification settings - Fork 93
150 lines (132 loc) · 4.27 KB
/
js-v2.yml
File metadata and controls
150 lines (132 loc) · 4.27 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
on:
push:
branches:
- main
pull_request:
branches:
- "*"
types:
- opened
- synchronize
- reopened
- ready_for_review
name: js-tests-v2
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
stateless-js-v2:
name: stateless-js-v2
runs-on: ubuntu-latest
services:
redis:
image: redis:8.0.1
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
LIGHT_PROTOCOL_VERSION: V2
REDIS_URL: redis://localhost:6379
CI: true
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Setup and build
uses: ./.github/actions/setup-and-build
with:
skip-components: "redis,disk-cleanup,go,photon"
cache-key: "js"
- name: Build stateless.js with V2
run: |
cd js/stateless.js
pnpm build:v2
- name: Build compressed-token with V2
run: |
cd js/compressed-token
pnpm build:v2
- name: Build CLI
run: |
npx nx build @lightprotocol/zk-compression-cli
- name: Build program-test
run: |
cd js/program-test
pnpm build:v2
- name: Start prover server
run: |
source ./scripts/devenv.sh
light start-prover &
sleep 5
- name: Run program-test tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/program-test
- name: Run stateless.js tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running stateless.js tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
until npx nx test @lightprotocol/stateless.js; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
exit 1
fi
echo "Attempt $attempt/$max_attempts failed, retrying..."
sleep 5
done
echo "Tests passed on attempt $attempt"
- name: Run compressed-token unit tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running compressed-token unit tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
until npx nx run @lightprotocol/compressed-token:test:unit:all:v2; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
exit 1
fi
echo "Attempt $attempt/$max_attempts failed, retrying..."
sleep 5
done
echo "Tests passed on attempt $attempt"
- name: Run compressed-token ctoken tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running compressed-token ctoken tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
cd js/compressed-token
until LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:ctoken:all; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
exit 1
fi
echo "Attempt $attempt/$max_attempts failed, retrying..."
sleep 5
done
echo "Tests passed on attempt $attempt"
- name: Run sdk-anchor-test TypeScript tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
npx nx build @lightprotocol/sdk-anchor-test
cd sdk-tests/sdk-anchor-test
npm run test-ts
- name: Display prover logs on failure
if: failure()
run: |
echo "=== Displaying prover logs ==="
find . -path "*/test-ledger/*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found"