From cdea900cb0c019041bde8e3c71cb798fe18dc07d Mon Sep 17 00:00:00 2001 From: n3wbie Date: Tue, 19 Nov 2024 03:09:30 +0900 Subject: [PATCH 1/9] feat: build gnogenesis --- .github/workflows/genesis-verify.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/genesis-verify.yml diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml new file mode 100644 index 00000000000..c430dfb410d --- /dev/null +++ b/.github/workflows/genesis-verify.yml @@ -0,0 +1,27 @@ +name: genesis-verify + +on: + push: + branches: + - master + paths: + - "misc/deployments/**" + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - name: Install dependencies + run: go mod download + + - name: Build gnogenesis + run: make -C contribs/gnogenesis \ No newline at end of file From 1782a8b8aea75b5d5dc19887460b6b959cd68f8e Mon Sep 17 00:00:00 2001 From: n3wbie Date: Tue, 19 Nov 2024 03:10:10 +0900 Subject: [PATCH 2/9] feat: look for only genesis.json located at misc/deployments/** --- .github/workflows/genesis-verify.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index c430dfb410d..69631380c96 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -1,11 +1,11 @@ name: genesis-verify on: - push: + pull_request: branches: - master paths: - - "misc/deployments/**" + - "misc/deployments/**/genesis.json" jobs: verify: @@ -24,4 +24,4 @@ jobs: run: go mod download - name: Build gnogenesis - run: make -C contribs/gnogenesis \ No newline at end of file + run: make -C contribs/gnogenesis From dde93155670aafa6c470393f709d1594b7eb0694 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Tue, 19 Nov 2024 03:10:38 +0900 Subject: [PATCH 3/9] feat: get list of changed genesis --- .github/workflows/genesis-verify.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index 69631380c96..91420803721 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -15,6 +15,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v41 + with: + files: "misc/deployments/**/genesis.json" + + - name: List changed genesis files + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + echo "Changed file: $file" + done + - name: Set up Go uses: actions/setup-go@v5 with: From 85bd424fc5da06f6d08c9e98d250a004ce0979cb Mon Sep 17 00:00:00 2001 From: n3wbie Date: Tue, 19 Nov 2024 03:11:14 +0900 Subject: [PATCH 4/9] feat: run `gnogenesis verify` --- .github/workflows/genesis-verify.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index 91420803721..4ac7b4c0a52 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -37,3 +37,10 @@ jobs: - 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 From b91d8bcbb9d9321cce25bfcff226bde9202444f6 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Tue, 19 Nov 2024 03:12:24 +0900 Subject: [PATCH 5/9] feat: run gnoland with changed genesis --- .github/workflows/genesis-verify.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index 4ac7b4c0a52..e01a9e3dfc9 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -44,3 +44,14 @@ jobs: 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" + gnoland start -lazy=true --genesis $file + # TODO: how to determine if the genesis is valid and chain did start? + done From 9f3ec963edd74af104fe7e511d9355434763c3dd Mon Sep 17 00:00:00 2001 From: n3wbie Date: Fri, 22 Nov 2024 10:54:08 +0900 Subject: [PATCH 6/9] feat: use strategy without failing fast - with 60s of waiting to see gnoland runs ok --- .github/workflows/genesis-verify.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index e01a9e3dfc9..1a9031a961f 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -9,8 +9,11 @@ on: jobs: verify: + strategy: + fail-fast: false + matrix: + testnet: ["test4.gno.land", "test5.gno.land"] runs-on: ubuntu-latest - timeout-minutes: 10 steps: - name: Checkout code uses: actions/checkout@v4 @@ -19,7 +22,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v41 with: - files: "misc/deployments/**/genesis.json" + files: "misc/deployments/${{ matrix.testnet }}/genesis.json" - name: List changed genesis files run: | @@ -52,6 +55,11 @@ jobs: run: | for file in ${{ steps.changed-files.outputs.all_changed_files }}; do echo "Running gnoland with $file" - gnoland start -lazy=true --genesis $file - # TODO: how to determine if the genesis is valid and chain did start? + timeout 60s gnoland start -lazy --genesis $file || exit_code=$? + if [ $exit_code -eq 124 ]; then + echo "Gnoland run successfully for 60 seconds" + else + echo "Gnoland failed to start with $file" + exit 1 + fi done From 922b90b7eb66e0b782f5a515cf63f579e6cf764c Mon Sep 17 00:00:00 2001 From: n3wbie Date: Fri, 22 Nov 2024 11:49:03 +0900 Subject: [PATCH 7/9] chore --- .github/workflows/genesis-verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index 1a9031a961f..4fa36ddcff4 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -55,7 +55,7 @@ jobs: 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=$? + timeout 60s gnoland start -lazy=true --genesis $file || exit_code=$? if [ $exit_code -eq 124 ]; then echo "Gnoland run successfully for 60 seconds" else From 52bcdf81353d9c44d85f10fa871ca6ad7f4ac6ff Mon Sep 17 00:00:00 2001 From: n3wbie Date: Fri, 22 Nov 2024 11:50:21 +0900 Subject: [PATCH 8/9] build: remove listing --- .github/workflows/genesis-verify.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index 4fa36ddcff4..91e000dc419 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -24,12 +24,6 @@ jobs: with: files: "misc/deployments/${{ matrix.testnet }}/genesis.json" - - name: List changed genesis files - run: | - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - echo "Changed file: $file" - done - - name: Set up Go uses: actions/setup-go@v5 with: From 83be3b2f0445fbb398afbf6537133325c11094b0 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Mon, 25 Nov 2024 10:12:03 +0900 Subject: [PATCH 9/9] chore --- .github/workflows/genesis-verify.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/genesis-verify.yml b/.github/workflows/genesis-verify.yml index 91e000dc419..6c9955b7178 100644 --- a/.github/workflows/genesis-verify.yml +++ b/.github/workflows/genesis-verify.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - testnet: ["test4.gno.land", "test5.gno.land"] + testnet: ["test5.gno.land"] runs-on: ubuntu-latest steps: - name: Checkout code @@ -29,9 +29,6 @@ jobs: with: go-version: "1.22" - - name: Install dependencies - run: go mod download - - name: Build gnogenesis run: make -C contribs/gnogenesis @@ -49,9 +46,9 @@ jobs: 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=$? + timeout 60s gnoland start -lazy --genesis $file || exit_code=$? if [ $exit_code -eq 124 ]; then - echo "Gnoland run successfully for 60 seconds" + echo "Gnoland genesis state generated successfully" else echo "Gnoland failed to start with $file" exit 1