forked from LayerZero-Labs/devtools
-
Notifications
You must be signed in to change notification settings - Fork 1
198 lines (167 loc) · 6.75 KB
/
Copy pathreusable-test.yaml
File metadata and controls
198 lines (167 loc) · 6.75 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
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.- .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-' `-`-' `-`-'
#
# Reusable workflow that runs the whole test suite, linter and build
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.- .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-' `-`-' `-`-'
name: Vape Tests
on:
workflow_call:
# We'll default the NPM_TOKEN to an empty value since we use it
# in .npmrc file and if undefined, the node setup would fail
env:
NPM_TOKEN: ""
jobs:
build:
name: Build & Lint
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: read
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest-16xlarge
arch: amd64
- platform: linux/arm64
runner: ubuntu-latest-16xlarge-arm
arch: arm64
# We'll run the job on the prebuilt base image
container:
image: ghcr.io/layerzero-labs/devtools-dev-base:main
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: "true"
- name: Setup environment
uses: ./.github/workflows/actions/setup-environment
- name: Install dependencies
uses: ./.github/workflows/actions/install-dependencies
- name: Setup build cache
uses: ./.github/workflows/actions/setup-build-cache
- name: Lint
run: pnpm lint
# We'll run the build in series to avoid race conditions
# when compiling hardhat projects in monorepo setups
- name: Build
run: pnpm build
test:
name: Test
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: read
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest-16xlarge
arch: amd64
- platform: linux/arm64
runner: ubuntu-latest-16xlarge-arm
arch: arm64
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: "true"
- name: Setup environment
uses: ./.github/workflows/actions/setup-environment
- name: Setup build cache
uses: ./.github/workflows/actions/setup-build-cache
# There is a small bug in docker compose that will cause 401 if we don't pull the base image manually
#
# See more here https://github.com/docker/compose-cli/issues/1545
- name: Authenticate to GHCR
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Test
run: pnpm test:ci
env:
# Disable parallel execution for now
LZ_ENABLE_EXPERIMENTAL_PARALLEL_EXECUTION: false
JEST_TIMEOUT: 30000 # Increase timeout for ARM builds
TEST_TIMEOUT: 300000 # 5 minutes timeout for long-running tests
# We'll use the prebuilt base image
DEVTOOLS_BASE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-base:main
# And the prebuilt hardhat EVM node image
DEVTOOLS_EVM_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-evm-hardhat:main
# And the prebuilt TON node image
DEVTOOLS_TON_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-ton-my-local-ton:main
# Provided we have good quality Solana RPCs, we can enable Solana tests
#
# FIXME The Solana tests need to be ported to either use a stable deployment
# or a local node. Until then, we disable the tests
# LZ_DEVTOOLS_ENABLE_SOLANA_TESTS: 1
RPC_URL_SOLANA_MAINNET: ${{ secrets.RPC_URL_SOLANA_MAINNET || 'https://rpc.ankr.com/solana' }}
RPC_URL_SOLANA_TESTNET: ${{ secrets.RPC_URL_SOLANA_TESTNET || 'https://api.devnet.solana.com' }}
# We'll collect the docker compose logs from all containers on failure
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
dest: "./logs"
# We'll collect the docker compose logs from all containers on failure
- name: Store docker logs
if: failure()
uses: actions/upload-artifact@v4
with:
path: ./logs
test-user:
name: User test
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: read
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest-16xlarge
arch: amd64
- platform: linux/arm64
runner: ubuntu-latest-16xlarge-arm
arch: arm64
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: "true"
- name: Setup environment
uses: ./.github/workflows/actions/setup-environment
# There is a small bug in docker compose that will cause 401 if we don't pull the base image manually
#
# See more here https://github.com/docker/compose-cli/issues/1545
- name: Authenticate to GHCR
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Test
run: pnpm test:user
env:
LAYERZERO_EXAMPLES_REPOSITORY_URL: https://github.com/${{ github.repository }}.git
LAYERZERO_EXAMPLES_REPOSITORY_REF: ${{ github.ref }}
# We'll use the prebuilt base image
DEVTOOLS_BASE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-base:main
# And the prebuilt hardhat EVM node image
DEVTOOLS_EVM_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-evm-hardhat:main
# Using the local Aptos testnet node
DEVTOOLS_APTOS_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-aptos-local-testnet:main
# Using the local TON node - i do not know if this is working
DEVTOOLS_TON_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-ton-my-local-ton:main
# Using the local Solana test validator - may fail due to RPC issues
DEVTOOLS_SOLANA_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-solana-test-validator:main
# We'll collect the docker compose logs from all containers on failure
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
dest: "./logs"
# We'll collect the docker compose logs from all containers on failure
- name: Store docker logs
if: failure()
uses: actions/upload-artifact@v4
with:
path: ./logs