Join Public Testnet #411
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: Join Public Testnet | |
on: | |
workflow_dispatch: | |
schedule: | |
# At 15:30 on Monday. | |
- cron: '30 15 * * 1' | |
concurrency: | |
group: self-hosted-runners | |
jobs: | |
test-public-testnet: | |
runs-on: cosmos-runner-set | |
steps: | |
# Get system info | |
- name: Install required packages | |
run: | | |
sudo apt update | |
sudo apt dist-upgrade -y | |
sudo apt -y install python-is-python3 python3-distutils screen curl jq wget python3-venv python3-pip net-tools git psmisc | |
- run: ifconfig | |
- run: lscpu | |
- run: df -h | |
- run: free -m | |
- run: uname -a | |
- run: lsb_release -a | |
- run: echo "GitHub branch is ${{ github.ref }}" | |
- run: whoami | |
- run: pwd | |
- name: mkdir ~/artifact | |
run: mkdir ~/artifact | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Init Python venv | |
run: python -m venv ~/env | |
- name: Install dependencies | |
run: | | |
source ~/env/bin/activate | |
python -m pip install --upgrade pip | |
python -m pip install toml toml-cli ansible | |
- name: Configure ansible.cfg | |
run: | | |
ansible_cfg=$(sed '/\[defaults\]/a transport = local' ansible.cfg); echo "$ansible_cfg" > ansible.cfg | |
- name: Install ansible-galaxy requirements | |
run: | | |
source ~/env/bin/activate | |
ansible-galaxy install -r requirements.yml | |
- name: Run playbook | |
run: | | |
source ~/env/bin/activate | |
chain_version=$(curl -s https://rpc.state-sync-01.theta-testnet.polypore.xyz/abci_info? | jq -r '.result.response.version') | |
ansible-playbook node.yml -i examples/inventory-release-testnet.yml --extra-vars "target=local reboot=false chain_version=$chain_version chain_home={{ node_user_home }}/.gaia node_user=runner enable_swap=false cosmovisor_invariants_flag='' chain_start=false use_cosmovisor=false" | |
- name: Create service script | |
run: | | |
echo "while true; do $HOME/go/bin/gaiad start --home $HOME/.gaia; sleep 1; done" > $HOME/gaiad.sh | |
chmod +x $HOME/gaiad.sh | |
- name: Start service in screen | |
run: screen -L -Logfile $HOME/artifact/gaiad.log -S gaiad -d -m bash $HOME/gaiad.sh | |
- name: Check blocks are being produced | |
run: | | |
height=$(curl -s http://rpc.state-sync-01.theta-testnet.polypore.xyz:26657/block | jq -r '.result.block.header.height') | |
echo "Waiting for block $[ $height + 100 ]..." | |
tests/test_block_production.sh 127.0.0.1 26657 100 | |
- name: Check if gaiad is still syncing | |
run: tests/test_still_syncing.sh 127.0.0.1 26657 | |
- name: Check blocks are being produced | |
run: | | |
chain_height=$(curl -s $RPC_ENDPOINT/block | jq -r '.result.block.header.height') | |
tests/test_block_production.sh 127.0.0.1 26657 10 | |
- name: Stop services | |
if: always() | |
run: | | |
killall screen | |
sleep 20 | |
- name: Upload artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-public-testnet | |
path: ~/artifact/ |