diff --git a/.github/workflows/emerald.yml b/.github/workflows/emerald.yml index 2102666..c6e2604 100644 --- a/.github/workflows/emerald.yml +++ b/.github/workflows/emerald.yml @@ -34,6 +34,18 @@ jobs: uses: actions/checkout@v5 with: submodules: recursive + + - id: filter + uses: dorny/paths-filter@v3 + with: + filters: | + code: + - '**/.rs' + - 'Makefile' + - '**/Cargo.toml' + - '**/Cargo.lock' + - '**/.sh' + - '*/workflows/emerald.yml' - name: Install Protoc uses: arduino/setup-protoc@v3 with: @@ -46,6 +58,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 - name: Run Forge build run: forge build + if: steps.filter.outputs.code == 'true' - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -54,14 +67,14 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Run emerald run: | - cargo build - ./scripts/generate_testnet_config.sh --nodes 3 --testnet-config-dir .testnet --fee-recipient 0x0000000000000000000000000000000000000042 + ./scripts/generate_testnet_config.sh --nodes 4 --testnet-config-dir .testnet --fee-recipient 0x0000000000000000000000000000000000000042 cargo run --bin emerald -- testnet --home nodes --testnet-config .testnet/testnet_config.toml ls nodes/*/config/priv_validator_key.json | xargs -I{} cargo run --bin emerald show-pubkey {} > nodes/validator_public_keys.txt cargo run --bin emerald-utils genesis --public-keys-file ./nodes/validator_public_keys.txt --devnet - docker compose up -d reth0 reth1 reth2 prometheus grafana otterscan - ./scripts/add_peers.sh --nodes 3 - bash scripts/spawn.bash --nodes 3 --home nodes --no-delay --no-wait + docker compose up -d reth0 reth1 reth2 reth3 prometheus grafana otterscan + ./scripts/add_peers.sh --nodes 4 + bash scripts/spawn.bash --nodes 4 --home nodes --no-delay --no-wait + if: steps.filter.outputs.code == 'true' - name: Upload test logs if: failure() diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a144f97..1f9c5f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,17 @@ jobs: uses: actions/checkout@v5 with: submodules: recursive + - id: filter + uses: dorny/paths-filter@v3 + with: + filters: | + code: + - '**/.rs' + - 'Makefile' + - '**/Cargo.toml' + - '**/Cargo.lock' + - '**/.sh' + - '*/workflows/test.yml' - name: Install Protoc uses: arduino/setup-protoc@v3 with: @@ -45,6 +56,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 - name: Run Forge build run: forge build + if: steps.filter.outputs.code == 'true' - name: Run tests run: | cargo nextest run \ @@ -52,3 +64,4 @@ jobs: --all-features \ --no-fail-fast \ --failure-output final + if: steps.filter.outputs.code == 'true'