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
56 changes: 56 additions & 0 deletions .github/workflows/genesis-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: genesis-verify

on:
pull_request:
branches:
- master
paths:
- "misc/deployments/**/genesis.json"

jobs:
verify:
strategy:
fail-fast: false
matrix:
testnet: ["test5.gno.land"]
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: 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 --genesis $file || exit_code=$?
if [ $exit_code -eq 124 ]; then
echo "Gnoland genesis state generated successfully"
else
echo "Gnoland failed to start with $file"
exit 1
fi
done
Loading