forked from immutable/ts-immutable-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
245 lines (209 loc) · 6.98 KB
/
pr.yaml
File metadata and controls
245 lines (209 loc) · 6.98 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
name: PR
on:
pull_request:
branches:
- main
merge_group:
branches:
- main
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.TS_IMMUTABLE_SDK_NX_TOKEN }}
jobs:
syncpack:
name: Syncpack
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Syncpack
run: yarn syncpack:check
detect:
name: Detect Node engine version change
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Node engine version from package.json
id: get_package_json_node_engine_version
run: |
node_engine_major_version=$(jq -r '.engines.node' ./sdk/package.json | sed 's/^>=//' | cut -d. -f1)
echo "::set-output name=node_engine_major_version::$node_engine_major_version"
- name: Get Node.js version from .nvmrc
id: get_nvmrc_node_version
run: echo "::set-output name=nvmrc_node_version::$(head -n 1 .nvmrc | cut -d. -f1)"
- name: Check Node.js engine version change
run: |
package_version_major=$(echo "${{ steps.get_package_json_node_engine_version.outputs.node_engine_major_version }}")
nvmrc_version_major=$(echo "${{ steps.get_nvmrc_node_version.outputs.nvmrc_node_version }}")
if [ "$package_version_major" != "$nvmrc_version_major" ]; then
echo "Node.js engine version has changed"
exit 1
else
echo "Node.js engine version has not changed"
fi
build-sdk:
name: Build SDK
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Build
run: yarn nx affected --target=build --parallel=5 --exclude=@imtbl/checkout-widgets-sample-app
typecheck-sdk:
name: Typecheck SDK
runs-on: ubuntu-latest-4-cores
needs: build-sdk
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Typecheck
run: yarn typecheck
test-sdk:
name: Test SDK
runs-on: ubuntu-latest-8-cores
needs: build-sdk
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Test
run: yarn test --configuration=ci
- name: Upload SDK test coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverages
path: ./packages/**/coverage/*
lint-sdk:
name: Lint SDK
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Lint
run: yarn lint
build-examples:
name: Build Examples
needs: build-sdk
runs-on: ubuntu-latest-4-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup
uses: ./.github/actions/setup
- name: Setup examples
uses: ./.github/actions/setup-examples
- name: Build examples
run: yarn build:examples
lint-examples:
name: Lint Examples
needs: build-sdk
runs-on: ubuntu-latest-4-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup
uses: ./.github/actions/setup
- name: Setup examples
uses: ./.github/actions/setup-examples
- name: Lint examples
run: yarn lint:examples
test-examples:
name: Test Examples
needs: build-sdk
runs-on: ubuntu-latest-4-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup
uses: ./.github/actions/setup
- name: Setup examples
uses: ./.github/actions/setup-examples
- name: Test examples
run: yarn test:examples
func-test-imx:
name: imx func tests
runs-on: ubuntu-latest-4-cores
needs: build-sdk
env:
NETWORK: sepolia
TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }}
PUBLIC_API_URL: "https://api.sandbox.x.immutable.com/v1"
TEST_STARK_CONTRACT_ADDRESS: "0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98"
TEST_REGISTRATION_CONTRACT_ADDRESS: "0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97"
TEST_TOKEN_ADDRESS: "0xfA5539fBEd27887EEbb2515672D80412D1A3ADa3"
TEST_WALLET1_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_PRIVATE_KEY }}
TEST_WALLET1_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_STARK_PRIVATE_KEY }}
TEST_WALLET2_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_PRIVATE_KEY }}
TEST_WALLET2_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_STARK_PRIVATE_KEY }}
TEST_WALLET_BANKER_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_PRIVATE_KEY }}
TEST_WALLET_BANKER_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_STARK_PRIVATE_KEY }}
TEST_STARKEX_BATCH_SIZE: 500
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Setup tests
uses: ./.github/actions/setup-tests
- name: test
run: yarn workspace @tests/func-tests-imx func-test:ci
func-test-zkevm:
name: zkevm func tests
runs-on: ubuntu-latest-4-cores
needs: build-sdk
env:
ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }}
ZKEVM_ORDERBOOK_ERC721: "0xBE8B131f39825282Ace9eFf99C0Bb14972417b49"
ZKEVM_ORDERBOOK_ERC1155: "0x2efB9B7810B1d1520c0822aa20F1889ABd2c2146"
SEAPORT_CONTRACT_ADDRESS: "0x7d117aA8BD6D31c4fa91722f246388f38ab1942c"
ZONE_CONTRACT_ADDRESS: "0x1004f9615E79462c711Ff05a386BdbA91a7628C3"
ZKEVM_RPC_ENDPOINT: "https://rpc.testnet.immutable.com"
ORDERBOOK_MR_API_URL: "https://api.sandbox.immutable.com"
ZKEVM_CHAIN_NAME: "imtbl-zkevm-testnet"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Setup tests
uses: ./.github/actions/setup-tests
- name: test
run: yarn workspace @tests/func-tests-zkevm func-test:ci