Skip to content

Commit

Permalink
ci: check snapshot height gth upgrade height (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond authored Nov 25, 2024
1 parent 99d34ab commit 9865400
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/software-upgrade-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
runs-on: elys-runner-x2

steps:
- name: Check if secrets are set
run: |
if [ -z "${{ secrets.R2_ACCESS_KEY }}" ]; then
echo "R2_ACCESS_KEY is not set."
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -92,6 +99,20 @@ jobs:
echo "SNAPSHOT_BLOCK_HEIGHT=$SNAPSHOT_BLOCK_HEIGHT" >> $GITHUB_ENV
echo "Snapshot block height: $SNAPSHOT_BLOCK_HEIGHT"
APPLIED_URL=https://api.testnet.elys.network/cosmos/upgrade/v1beta1/applied_plan/${LAST_TAG}
curl -L $APPLIED_URL -o /tmp/applied.json
echo "Applied.json downloaded to check snapshot version."
# retrieve height field value from applied.json
UPGRADE_HEIGHT=$(cat /tmp/applied.json | awk -F'"' '/"height":/{print $4}')
echo "Upgrade height: $UPGRADE_HEIGHT"
# SNAPSHOT_BLOCK_HEIGHT must be greater than UPGRADE_HEIGHT
if [ $SNAPSHOT_BLOCK_HEIGHT -le $UPGRADE_HEIGHT ]; then
echo "Snapshot block height ($SNAPSHOT_BLOCK_HEIGHT) is not greater than upgrade height ($UPGRADE_HEIGHT)."
exit 1
fi
# set snapshot download url
SNAPSHOT_DOWNLOAD_URL=https://snapshots-testnet.stake-town.com/elys/elystestnet-1_latest.tar.lz4
echo "SNAPSHOT_DOWNLOAD_URL=$SNAPSHOT_DOWNLOAD_URL" >> $GITHUB_ENV
Expand Down

0 comments on commit 9865400

Please sign in to comment.