refactor script, clone stack separately

This commit is contained in:
Roy Crihfield 2024-06-26 21:17:03 +08:00
parent 3d9a39bb1a
commit 26e720a28a
2 changed files with 26 additions and 22 deletions

View File

@ -10,6 +10,7 @@ on:
env:
SO_VERSION: v1.1.0-87fffca-202404110321
FIXTURENET_ETH_STACKS_VERSION: plugeth-stack
jobs:
unit-tests:
@ -31,34 +32,42 @@ jobs:
name: Run integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: ./plugeth-statediff
progress: false
- name: Build docker image
run: |
docker build ./plugeth-statediff -t cerc/plugeth-statediff:local
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install stack-orchestrator
run: |
curl -L -O https://github.com/cerc-io/stack-orchestrator/releases/download/$SO_VERSION/laconic-so
chmod +x laconic-so
echo PATH="$PATH:$(pwd)" >> $GITHUB_ENV
- name: Clone system-tests
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: cerc-io/system-tests
ref: v0.1.0-20240411
path: ./system-tests
token: ${{ secrets.CICD_REPO_TOKEN }}
progress: false
- name: Clone fixturenet stack repo
uses: actions/checkout@v4
with:
repository: cerc-io/fixturenet-eth-stacks
ref: ${{ env.FIXTURENET_ETH_STACKS_VERSION }}
path: ./fixturenet-eth-stacks
progress: false
- name: Run testnet stack
working-directory: ./plugeth-statediff
env:
LACONIC_SO: ../laconic-so
run: ./scripts/integration-setup.sh
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.11
run: |
./scripts/run-test-stack.sh ../fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth
- name: Run tests
working-directory: ./system-tests
run: |

View File

@ -1,26 +1,21 @@
#!/bin/bash
# Builds and deploys a stack with only what we need.
# This script assumes we are running in the project root.
set -e
set -ex
STACK_URL="git.vdb.to/cerc-io/fixturenet-eth-stacks"
[[ -d "$1" ]]
CONFIG_DIR=$(readlink -f "${CONFIG_DIR:-$(mktemp -d)}")
# By default assume we are running in the project root.
export CERC_REPO_BASE_DIR="${CERC_REPO_BASE_DIR:-$(git rev-parse --show-toplevel)/..}"
laconic-so --verbose fetch-stack "$STACK_URL"
stack_dir=$CERC_REPO_BASE_DIR/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth
git -C $stack_dir checkout origin/plugeth-stack
# Note: stack path should be absolute, otherwise SO looks for it in packaged stacks
laconic_so="laconic-so --stack $stack_dir --verbose"
stack_dir=$(readlink -f "$1")
echo CERC_STATEDIFF_DB_GOOSE_MIN_VER=21 >> $CONFIG_DIR/stack.env
# don't run plugeth in the debugger
laconic_so="laconic-so --verbose --stack $stack_dir"
# Don't run geth/plugeth in the debugger, it will swallow error backtraces
echo CERC_REMOTE_DEBUG=false >> $CONFIG_DIR/stack.env
set -x
if [[ -z $SKIP_BUILD ]]; then
$laconic_so setup-repositories \