-
Notifications
You must be signed in to change notification settings - Fork 66
66 lines (63 loc) · 2.99 KB
/
e2e.yml
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
name: Run E2E tests
on:
workflow_dispatch:
jobs:
end_to_end_test:
runs-on: ["ubuntu-latest"]
env:
GOPRIVATE: "github.com/dymensionxyz/*"
GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}"
ROLLER_CONFIG_PATH: "${{ github.workspace }}/tmp/e2e_roller_config" # Setting the environment variable
ROLLAPP_ID: "endtoend_1-${{ github.run_number }}"
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/
- name: Init a local rollapp within screen
run: |
# Start a new detached screen session named "rollapp_init"
screen -dmS rollapp_init
# Send the commands to be executed in the screen session
screen -S rollapp_init -X stuff "rm -rf $ROLLER_CONFIG_PATH\n"
screen -S rollapp_init -X stuff "echo 'Executing: go run . config init --home $ROLLER_CONFIG_PATH --da mock $ROLLAPP_ID RAX --hub local --no-output'\n"
screen -S rollapp_init -X stuff "go run . config init --home $ROLLER_CONFIG_PATH --da mock $ROLLAPP_ID RAX --hub local --no-output\n"
# Wait a bit for the command to execute. Adjust this sleep time as necessary
sleep 10
# Kill the screen session after the command is done
screen -S rollapp_init -X quit
- name: Run the local hub
run: |
screen -dmS hub-session /usr/local/bin/dymd start --home "$ROLLER_CONFIG_PATH/local-hub"
sleep 5
HUB_PID=$(pgrep -f 'dymd start --home' | head -n 1)
echo "Captured PID: $HUB_PID"
echo "HUB_PID=$HUB_PID" >> $GITHUB_ENV
- name: Fund the RollApp addresses
run: |
HUB_SEQ_ADDR=$(go run . keys list --home $ROLLER_CONFIG_PATH --output json | jq -r '.hub_sequencer')
echo "HUB_SEQ_ADDR=$HUB_SEQ_ADDR" >> $GITHUB_ENV
RELAYER_ROLLAPP_ADDR=$(go run . keys list --home $ROLLER_CONFIG_PATH --output json | jq -r '."relayer-hub-key"')
/usr/local/bin/dymd tx bank multi-send local-user $HUB_SEQ_ADDR $RELAYER_ROLLAPP_ADDR 1adym --yes -b block --keyring-backend test --home $ROLLER_CONFIG_PATH/local-hub --node http://127.0.0.1:36657
sleep 10
- name: Register the rollapp
run: |
go run . tx register --home $ROLLER_CONFIG_PATH --no-output
- name: Run the rollapp
run: |
go run . run --home $ROLLER_CONFIG_PATH --no-output &
echo "ROLLAPP_PID=$!" >> $GITHUB_ENV
- name: Execute IBC relay tester
run: |
chmod +x ./scripts/ibc_relay_tester.sh
DEST_ADDR=$HUB_SEQ_ADDR ROLLAPP_ID=$ROLLAPP_ID ROLLER_CONFIG_PATH=$ROLLER_CONFIG_PATH ./scripts/ibc_relay_tester.sh 2> script_errors.log
- name: Terminate the rollapp
if: always()
run: |
kill $ROLLAPP_PID
- name: Terminate the hub
if: always()
run: |
kill $HUB_PID