Skip to content

Commit 8c0819d

Browse files
github workflow testing for e2e
1 parent 698a73b commit 8c0819d

File tree

2 files changed

+31
-66
lines changed

2 files changed

+31
-66
lines changed

.github/Solana-key.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[156,214,52,226,101,141,187,127,80,230,163,132,41,11,225,162,81,118,242,213,213,115,202,74,97,141,5,10,174,133,85,224,183,10,143,212,142,103,199,43,238,47,236,199,89,218,36,117,140,129,195,8,60,178,93,132,86,200,130,56,251,157,235,138]

.github/workflows/e2e.yml

Lines changed: 30 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,43 @@
1-
name: E2E Tests
1+
name: E2E Test Workflow
22

33
on:
44
push:
5-
branches: [ e2e-test ]
5+
branches:
6+
- e2e-test
67
pull_request:
7-
branches: [ e2e-test ]
8+
branches:
9+
- e2e-test
10+
workflow_dispatch:
811

912
jobs:
10-
e2e:
13+
e2e-test:
1114
runs-on: ubuntu-latest
1215

1316
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v4
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Solana CLI
21+
run: |
22+
sudo sh -c "$(curl -sSfL https://release.solana.com/v1.14.17/install)"
23+
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
24+
25+
- name: Start Solana Test Validator
26+
run: |
27+
solana-test-validator --reset --rpc-port 8899 --limit-ledger-size 50000000 --url https://api.devnet.solana.com \
28+
--clone ETGtqwDKEm1Z9gq6FdvYUfyDuUZr7g4UdPSmyNLVGriX \
29+
--clone 7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE &
1630
17-
- name: Clean Go cache
18-
run: |
19-
go clean -modcache
20-
rm -rf ~/go/pkg/mod
31+
- name: Wait for validator to start
32+
run: sleep 10
2133

22-
- name: Install Foundry (Forge)
23-
run: |
24-
curl -L https://foundry.paradigm.xyz | bash
25-
source ~/.foundry/bin/foundryup
26-
forge --version
34+
- name: Set Solana Keypair Environment
35+
run: |
36+
export SOLANA_KEYPAIR="$(pwd)/.github/Solana-key.json"
37+
solana config set --keypair "$SOLANA_KEYPAIR"
2738
28-
- name: Install Solana CLI
29-
run: |
30-
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
31-
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
32-
solana --version
39+
- name: Run E2E Tests
40+
run: make e2e
3341

34-
- name: Setup Node.js and Yarn
35-
uses: actions/setup-node@v4
36-
with:
37-
node-version: 20
38-
cache: yarn
39-
40-
- name: Verify Yarn
41-
run: yarn --version
42-
43-
- name: Configure Solana Keypair
44-
run: |
45-
mkdir -p ~/.config/solana
46-
cp .github/workflow/id.json ~/.config/solana/id.json
47-
solana config set --keypair ~/.config/solana/id.json
48-
solana address
49-
50-
- name: Start Solana Test Validator
51-
run: |
52-
solana-test-validator \
53-
--reset \
54-
--rpc-port 8899 \
55-
--limit-ledger-size 50000000 \
56-
--url https://api.devnet.solana.com \
57-
--clone ETGtqwDKEm1Z9gq6FdvYUfyDuUZr7g4UdPSmyNLVGriX \
58-
7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE \
59-
> validator.log 2>&1 &
60-
echo "Waiting for Solana test validator to start..."
61-
sleep 15
62-
solana cluster-version --url http://127.0.0.1:8899
63-
64-
- name: Run E2E Tests
65-
env:
66-
ANVIL_URL: http://localhost:9545
67-
PUSH_EVM_URL: http://localhost:8545
68-
CHAIN_RPC: http://localhost:26657
69-
CHAIN_ID: localchain_9000-1
70-
run: |
71-
source ~/.foundry/bin/init.sh || true
72-
make e2e
73-
74-
- name: Upload Logs
75-
if: always()
76-
uses: actions/upload-artifact@v4
77-
with:
78-
name: validator-log
79-
path: validator.log
42+
- name: Stop Solana Test Validator
43+
run: pkill solana-test-validator || true

0 commit comments

Comments
 (0)