running the init command within a screen session to solve key generat… #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run E2E tests | |
on: | |
push: | |
branches: | |
- itaylevyofficial/286-endtoendtests | |
release: | |
types: [ created ] | |
workflow_dispatch: | |
jobs: | |
end_to_end_test: | |
runs-on: [ "arm-linux" ] | |
env: | |
GOPRIVATE: "github.com/dymensionxyz/*" | |
GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}" | |
ROLLER_CONFIG_PATH: "~/tmp/e2e_roller_config" # Setting the environment variable | |
ROLLAPP_ID: "endtoend_1-${{ github.run_number }}" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19.10 | |
- 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: Fund the RollApp addresses | |
run: | | |
HUB_SEQ_ADDR=$(go run . keys list --output json | jq -r '.hub_sequencer') | |
echo "HUB_SEQ_ADDR=$HUB_SEQ_ADDR" >> $GITHUB_ENV | |
RELAYER_ROLLAPP_ADDR=$(go run . keys list --output json | jq -r '.relayer-rollapp-key') | |
/usr/local/bin/dymd tx bank multi-send local-user $HUB_SEQ_ADDR $RELAYER_ROLLAPP_ADDR 1udym --yes -b block --keyring-backend test --home $ROLLER_CONFIG_PATH/local-hub | |
- name: Register the rollapp | |
run: | | |
go run . register --home $ROLLER_CONFIG_PATH --no-output | |
- name: Run the rollapp | |
run: | | |
go run . run --home $ROLLER_CONFIG_PATH & | |
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 | |
- name: Terminate the rollapp | |
run: | | |
kill $ROLLAPP_PID |