CI test
This commit is contained in:
parent
9b937d9071
commit
76b8359bea
@ -1,7 +1,12 @@
|
|||||||
name: Test
|
name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
pull_request:
|
||||||
|
branches: '*'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- ci-test
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
unit-tests:
|
||||||
@ -31,7 +36,7 @@ jobs:
|
|||||||
- name: "Install stack-orchestrator"
|
- name: "Install stack-orchestrator"
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: cerc-io/stack-orchestrator
|
repository: https://github.com/roysc/stack-orchestrator
|
||||||
ref: plugeth-testing
|
ref: plugeth-testing
|
||||||
path: ./stack-orchestrator
|
path: ./stack-orchestrator
|
||||||
- name: "Run testnet stack"
|
- name: "Run testnet stack"
|
||||||
@ -45,7 +50,7 @@ jobs:
|
|||||||
ref: roy/dev
|
ref: roy/dev
|
||||||
path: ./system-tests
|
path: ./system-tests
|
||||||
- name: "Build docker image"
|
- name: "Build docker image"
|
||||||
run: make docker
|
run: make docker-image
|
||||||
- name: "Run tests"
|
- name: "Run tests"
|
||||||
run: |
|
run: |
|
||||||
pytest -v \
|
pytest -v \
|
||||||
|
4
Makefile
4
Makefile
@ -8,9 +8,9 @@ $(MOCKS_DIR)/gen_backend.go:
|
|||||||
$(MOCKGEN) --package mocks --destination $@ \
|
$(MOCKGEN) --package mocks --destination $@ \
|
||||||
github.com/openrelayxyz/plugeth-utils/core Backend,Downloader
|
github.com/openrelayxyz/plugeth-utils/core Backend,Downloader
|
||||||
|
|
||||||
docker: mocks
|
docker-image: mocks
|
||||||
docker build . -t "cerc/plugeth-statediff:local"
|
docker build . -t "cerc/plugeth-statediff:local"
|
||||||
.PHONY: docker
|
.PHONY: docker-image
|
||||||
|
|
||||||
# Local build
|
# Local build
|
||||||
BUILD_FLAGS := --trimpath
|
BUILD_FLAGS := --trimpath
|
||||||
|
40
scripts/integration-setup.sh
Executable file
40
scripts/integration-setup.sh
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
cluster="${1:-test}"
|
||||||
|
laconic_so="${LACONIC_SO:-laconic-so} --stack fixturenet-plugeth-tx --verbose --debug"
|
||||||
|
|
||||||
|
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:-$(realpath $(git rev-parse --show-toplevel)/..)}"
|
||||||
|
|
||||||
|
# v5 migrations only go up to version 18
|
||||||
|
echo CERC_STATEDIFF_DB_GOOSE_MIN_VER=18 >> $CONFIG_DIR/stack.env
|
||||||
|
|
||||||
|
# Build and deploy a cluster with only what we need from the stack
|
||||||
|
$laconic_so setup-repositories \
|
||||||
|
--exclude github.com/cerc-io/ipld-eth-server,github.com/cerc-io/tx-spammer,git.vdb.to/cerc-io/plugeth-statediff \
|
||||||
|
--branches-file ./test/stack-refs.txt
|
||||||
|
|
||||||
|
$laconic_so build-containers \
|
||||||
|
--exclude cerc/ipld-eth-server,cerc/keycloak,cerc/tx-spammer,cerc/foundry
|
||||||
|
|
||||||
|
$laconic_so deploy \
|
||||||
|
--exclude foundry,keycloak,tx-spammer \
|
||||||
|
--env-file $CONFIG_DIR/stack.env \
|
||||||
|
--cluster "$cluster" up
|
||||||
|
|
||||||
|
set +x
|
||||||
|
|
||||||
|
# Output vars if we are running on Github
|
||||||
|
if [[ -n "$GITHUB_ENV" ]]; then
|
||||||
|
bootnode_port=$($laconic_so deploy --cluster $cluster port fixturenet-eth-bootnode-geth 9898 | head -1 | cut -d':' -f2)
|
||||||
|
geth_port=$($laconic_so deploy --cluster $cluster port fixturenet-eth-geth-1 8545 | cut -d':' -f2)
|
||||||
|
eis_port=$($laconic_so deploy --cluster $cluster port ipld-eth-server 8081 | cut -d':' -f2)
|
||||||
|
|
||||||
|
echo GETH_BOOTNODE_URL="http://localhost:$bootnode_port" >> "$GITHUB_ENV"
|
||||||
|
echo GETH_URL="http://localhost:$geth_port" >> "$GITHUB_ENV"
|
||||||
|
echo IPLD_ETH_URL="http://localhost:$eis_port" >> "$GITHUB_ENV"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user