Skip to content

Commit

Permalink
CI Check genesis files (#903)
Browse files Browse the repository at this point in the history
* Test ci

* Test ci 2

* Test ci 3

* Test ci 4

* Gitkeep state dir for temp genesis files

* Test if ci works & revert python script

* Remove comments of cis

* Reduces unnecessary sleep

* New script using git diff

* Test ci works

* Test ci

* CI should work
  • Loading branch information
ercecan authored Jul 19, 2024
1 parent d54cf83 commit 57a326e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/scripts/check_genesis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Run make command
make genesis

sleep 1

# Check if script generates different genesis
git diff --exit-code ./resources/

if [ $? -ne 0 ]; then
echo "Differences found in genesis files."
exit 1
fi

echo "All directories are identical."

exit 0
26 changes: 26 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,29 @@ jobs:
cd crates/evm/src/evm/system_contracts
forge test -vvv
id: test
check_genesis_files:
strategy:
fail-fast: true

name: Check Genesis Files
runs-on: ubicloud-standard-2
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Run check_genesis.sh
run: ./.github/scripts/check_genesis.sh
shell: bash

3 changes: 2 additions & 1 deletion crates/evm/src/evm/system_contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Compiler files
cache/
out/
state/
state/*.json


# Ignores development broadcast logs
!/broadcast
Expand Down
Empty file.

0 comments on commit 57a326e

Please sign in to comment.