-
Notifications
You must be signed in to change notification settings - Fork 8
210 lines (179 loc) · 7.41 KB
/
Copy pathe2e.yml
File metadata and controls
210 lines (179 loc) · 7.41 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
name: E2E (tmpnet)
on:
# Push to main always runs full E2E.
push:
branches: [main]
# PRs only run E2E when they touch SDK code that the tmpnet suite exercises,
# or when they touch the e2e package itself. Avoids spending ~10 min per PR on
# docs/dependabot/chainkit changes.
pull_request:
branches: [main]
paths:
- "e2e/**"
- "interchain/**"
- "client/src/utils/**"
- "client/src/methods/wallet/pChain/**"
- ".github/workflows/e2e.yml"
workflow_dispatch:
inputs:
avalanchego_version:
description: "AvalancheGo version (e.g. v1.14.0)"
required: false
default: "v1.14.0"
subnet_evm_version:
description: "Subnet-EVM version (e.g. v0.8.0)"
required: false
default: "v0.8.0"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Minimal token permissions. The job only needs to read the repo contents
# (for `actions/checkout`) — no write access to issues, PRs, packages, etc.
permissions:
contents: read
env:
BUN_VERSION: "1.1.38"
AVALANCHEGO_VERSION: ${{ github.event.inputs.avalanchego_version || 'v1.14.0' }}
SUBNET_EVM_VERSION: ${{ github.event.inputs.subnet_evm_version || 'v0.8.0' }}
SIGNATURE_AGGREGATOR_VERSION: "v0.5.3"
ICM_RELAYER_VERSION: "v1.7.4"
ICM_CONTRACTS_VERSION: "v1.0.9"
jobs:
e2e:
name: tmpnet integration
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: e2e
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache Bun deps
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('e2e/package.json', 'client/package.json', 'interchain/package.json') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Cache Avalanche binaries
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.avalanche-cli/bin
~/.avalanchego/plugins
key: avalanche-bins-${{ env.AVALANCHEGO_VERSION }}-${{ env.SUBNET_EVM_VERSION }}-${{ env.SIGNATURE_AGGREGATOR_VERSION }}-${{ env.ICM_RELAYER_VERSION }}
- name: Install client + interchain deps
working-directory: ${{ github.workspace }}
run: |
cd client && bun install --frozen-lockfile || bun install
cd ../interchain && bun install --frozen-lockfile || bun install
- name: Build interchain (postbuild adds .js extensions)
working-directory: interchain
run: bun run build
- name: Build client types + esm (e2e imports require dist/_types and dist/_esm)
working-directory: client
run: |
# Skip build:cjs + build:webpack — e2e only needs ESM + types.
bun run clean
bun run build:esm
bun run build:types
# Install e2e LAST so `file:` deps snapshot the freshly-built dist/ folders.
# bun install with file: copies the source dir at install time; building
# client/interchain afterwards wouldn't propagate into e2e/node_modules.
- name: Install e2e deps
working-directory: e2e
run: bun install
- name: Create binary dirs
run: |
mkdir -p ~/.avalanche-cli/bin
mkdir -p ~/.avalanchego/plugins
- name: Download AvalancheGo
run: |
set -e
VERSION="${AVALANCHEGO_VERSION}"
INSTALL_DIR="$HOME/.avalanche-cli/bin/$VERSION"
BINARY_PATH="$INSTALL_DIR/avalanchego"
if [ -f "$BINARY_PATH" ]; then
echo "AvalancheGo $VERSION already cached"
chmod +x "$BINARY_PATH"
exit 0
fi
mkdir -p "$INSTALL_DIR"
ASSET_NAME="avalanchego-linux-amd64-${VERSION}.tar.gz"
DOWNLOAD_URL="https://github.com/ava-labs/avalanchego/releases/download/${VERSION}/${ASSET_NAME}"
echo "Downloading AvalancheGo $VERSION..."
curl -L -o "$INSTALL_DIR/$ASSET_NAME" "$DOWNLOAD_URL"
tar -xzf "$INSTALL_DIR/$ASSET_NAME" -C "$INSTALL_DIR"
EXTRACTED_DIR="$INSTALL_DIR/avalanchego-${VERSION}"
if [ -d "$EXTRACTED_DIR" ]; then
mv "$EXTRACTED_DIR/avalanchego" "$BINARY_PATH"
rm -rf "$EXTRACTED_DIR"
fi
chmod +x "$BINARY_PATH"
rm -f "$INSTALL_DIR/$ASSET_NAME"
- name: Download Subnet-EVM
run: |
set -e
VERSION="${SUBNET_EVM_VERSION}"
INSTALL_DIR="$HOME/.avalanche-cli/bin/subnet-evm/subnet-evm-${VERSION}"
BINARY_PATH="$INSTALL_DIR/subnet-evm"
PLUGIN_PATH="$HOME/.avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
if [ -f "$BINARY_PATH" ] && [ -f "$PLUGIN_PATH" ]; then
echo "Subnet-EVM $VERSION already cached"
chmod +x "$BINARY_PATH" "$PLUGIN_PATH"
exit 0
fi
mkdir -p "$INSTALL_DIR"
ASSET_NAME="subnet-evm_${VERSION#v}_linux_amd64.tar.gz"
DOWNLOAD_URL="https://github.com/ava-labs/subnet-evm/releases/download/${VERSION}/${ASSET_NAME}"
curl -L -o "$INSTALL_DIR/$ASSET_NAME" "$DOWNLOAD_URL"
tar -xzf "$INSTALL_DIR/$ASSET_NAME" -C "$INSTALL_DIR"
chmod +x "$BINARY_PATH"
cp "$BINARY_PATH" "$PLUGIN_PATH"
chmod +x "$PLUGIN_PATH"
rm -f "$INSTALL_DIR/$ASSET_NAME"
- name: Download Signature Aggregator (not used yet — staged for follow-up)
run: |
set -e
VERSION="${SIGNATURE_AGGREGATOR_VERSION}"
INSTALL_DIR="$HOME/.avalanche-cli/bin/signature-aggregator/signature-aggregator-${VERSION}"
BINARY_PATH="$INSTALL_DIR/signature-aggregator"
if [ -f "$BINARY_PATH" ]; then
chmod +x "$BINARY_PATH"
exit 0
fi
mkdir -p "$INSTALL_DIR"
ASSET_NAME="signature-aggregator_${VERSION#v}_linux_amd64.tar.gz"
DOWNLOAD_URL="https://github.com/ava-labs/icm-services/releases/download/signature-aggregator-${VERSION}/${ASSET_NAME}"
curl -L -o "$INSTALL_DIR/$ASSET_NAME" "$DOWNLOAD_URL"
tar -xzf "$INSTALL_DIR/$ASSET_NAME" -C "$INSTALL_DIR"
chmod +x "$BINARY_PATH"
rm -f "$INSTALL_DIR/$ASSET_NAME"
- name: Verify binaries
run: |
echo "=== AvalancheGo ==="
~/.avalanche-cli/bin/${AVALANCHEGO_VERSION}/avalanchego --version || true
echo "=== Subnet-EVM plugin ==="
ls -la ~/.avalanchego/plugins/
echo "=== Signature Aggregator ==="
ls -la ~/.avalanche-cli/bin/signature-aggregator/ || true
- name: Typecheck e2e package
run: bun run typecheck
- name: Run integration tests
env:
AVALANCHEGO_PATH: ${{ format('{0}/.avalanche-cli/bin/{1}/avalanchego', github.workspace, env.AVALANCHEGO_VERSION) }}
run: bun run test:integration
- name: Upload tmpnet logs on failure
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: tmpnet-logs
path: |
~/.avalanche-cli/tmpnet/
~/.avalanche-cli/logs/
retention-days: 3