Skip to content

Commit

Permalink
Add CI step
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Aug 3, 2024
1 parent 2c82519 commit 802814c
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/post-merge-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test

on:
pull_request:
push:
branches:
- master

env:
REQWEST_TEST_BODY_FULL: 1
RUST_BACKTRACE: 1

jobs:
post-merge-run:
name: Test post merge run
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust || 'stable' }}
targets: ${{ matrix.target }}
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker
brew install docker-buildx
# Vectors are already generated, but this serves as a test
- name: Generate vectors
run: ./generate_test_vectors.sh
# Test vectors against nethermind
- name: Apply vectors to Nethermind
run: ./apply_test_vectors_nethermind.sh
# Test vectors against Reth
- name: Apply vectors to Reth
run: ./apply_test_vectors_reth.sh


8 changes: 8 additions & 0 deletions apply_test_vectors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ OUT_DIR=./blocks

N=5

# Retry the curl command until it succeeds
until curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x0", false],"id":1}' \
http://localhost:8545; do
echo "Retrying..."
sleep 2
done


function apply_block_file() {
BLOCK_FILEPATH=$1
Expand Down
8 changes: 8 additions & 0 deletions apply_test_vectors_nethermind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

./run_nethermind.sh &
./apply_test_vectors.sh
# TODO more resilient shutdown
docker rm -f neth-vec-gen 2>/dev/null

7 changes: 7 additions & 0 deletions apply_test_vectors_reth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

./run_reth.sh &
./apply_test_vectors.sh


0 comments on commit 802814c

Please sign in to comment.