-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (75 loc) · 2.34 KB
/
e2e.yml
File metadata and controls
86 lines (75 loc) · 2.34 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
name: E2E Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Run daily at midnight UTC
- cron: '0 0 * * *'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
e2e-localnet:
name: E2E Tests (Localnet)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.90"
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install Aptos CLI
run: |
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Verify Aptos CLI installation
run: aptos --version
- name: Start localnet
run: |
aptos node run-localnet --with-faucet --force-restart > "${{ runner.temp }}/localnet.log" 2>&1 &
echo "LOCALNET_PID=$!" >> $GITHUB_ENV
# Wait for localnet to be ready
for i in $(seq 1 90); do
if curl -s http://127.0.0.1:8080/v1 > /dev/null 2>&1; then
echo "Localnet is ready after ~$((i * 2))s"
break
fi
if [ "$i" -eq 90 ]; then
echo "Localnet failed to start within 180s"
cat "${{ runner.temp }}/localnet.log"
exit 1
fi
sleep 2
done
# Wait for faucet to be ready
for i in $(seq 1 30); do
if curl -s http://127.0.0.1:8081/health > /dev/null 2>&1; then
echo "Faucet is ready"
break
fi
if [ "$i" -eq 30 ]; then
echo "Faucet failed to start within 60s"
cat "${{ runner.temp }}/localnet.log"
exit 1
fi
sleep 2
done
- name: Run E2E tests
env:
APTOS_LOCAL_FAUCET_URL: http://127.0.0.1:8081
APTOS_LOCAL_NODE_URL: http://127.0.0.1:8080/v1
run: cargo test -p aptos-sdk --features "e2e,full" -- --ignored
- name: Print localnet logs on failure
if: failure()
run: cat "${{ runner.temp }}/localnet.log"
- name: Stop localnet
if: always()
run: |
kill "$LOCALNET_PID" 2>/dev/null || true
pkill -f "aptos node" || true