Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: validate genesis.json #3170

Merged
merged 11 commits into from
Nov 26, 2024
59 changes: 59 additions & 0 deletions .github/workflows/genesis-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: genesis-verify
ltzmaxwell marked this conversation as resolved.
Show resolved Hide resolved

on:
pull_request:
branches:
- master
paths:
- "misc/deployments/**/genesis.json"
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

jobs:
verify:
strategy:
fail-fast: false
matrix:
testnet: ["test4.gno.land", "test5.gno.land"]
sw360cab marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: "misc/deployments/${{ matrix.testnet }}/genesis.json"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Install dependencies
run: go mod download
sw360cab marked this conversation as resolved.
Show resolved Hide resolved

- name: Build gnogenesis
run: make -C contribs/gnogenesis

- name: Verify each genesis file
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Verifying $file"
gnogenesis verify -genesis-path $file
done

- name: Build gnoland
run: make -C gno.land install.gnoland

- name: Running latest gnoland with each genesis file
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Running gnoland with $file"
timeout 60s gnoland start -lazy=true --genesis $file || exit_code=$?
sw360cab marked this conversation as resolved.
Show resolved Hide resolved
if [ $exit_code -eq 124 ]; then
echo "Gnoland run successfully for 60 seconds"
sw360cab marked this conversation as resolved.
Show resolved Hide resolved
else
echo "Gnoland failed to start with $file"
exit 1
fi
done
Loading