2022-06-02 11:59:44 +00:00
name : Test the stack.
on :
workflow_call :
2022-06-17 15:37:50 +00:00
inputs :
STACK_ORCHESTRATOR_REF :
required : true
type : string
GO_ETHEREUM_REF :
required : true
type : string
IPLD_ETH_DB_REF :
required : true
type : string
2022-06-02 11:59:44 +00:00
jobs :
build :
name : Run docker build
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v2
- name : Run docker build
run : make docker-build
test :
name : Run unit tests
env :
GOPATH : /tmp/go
2023-03-31 14:48:41 +00:00
2022-06-02 11:59:44 +00:00
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v2
2023-03-31 14:48:41 +00:00
- name : Set up Go
uses : actions/setup-go@v4
with :
go-version : 1.19 .7
2023-04-01 16:38:23 +00:00
- name : Bring up docker timescaledb container
run : docker compose up -d ipld-eth-db
2022-06-02 11:59:44 +00:00
2023-04-01 16:38:23 +00:00
- name : Run db migrations
2022-06-02 11:59:44 +00:00
run : |
2023-04-01 16:38:23 +00:00
sleep 30;
docker compose up -d migrations
2022-06-02 11:59:44 +00:00
2023-04-01 16:38:23 +00:00
- name : Run test
2022-06-02 11:59:44 +00:00
run : |
2023-04-01 16:38:23 +00:00
sleep 30;
PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=password DATABASE_HOSTNAME=127.0.0.1 DATABASE_NAME=vulcanize_testing make test
2022-06-02 11:59:44 +00:00
integrationtest :
name : Run integration tests
env :
GOPATH : /tmp/go
DB_WRITE : true
ETH_FORWARD_ETH_CALLS : false
ETH_PROXY_ON_ERROR : false
ETH_HTTP_PATH : "go-ethereum:8545"
runs-on : ubuntu-latest
steps :
2023-03-31 14:48:41 +00:00
- uses : actions/checkout@v2
- name : Set up Go
uses : actions/setup-go@v4
with :
go-version : 1.19 .7
2022-06-02 11:59:44 +00:00
- name : Create GOPATH
run : mkdir -p /tmp/go
- uses : actions/checkout@v2
with :
path : "./ipld-eth-server"
- uses : actions/checkout@v2
with :
2022-06-17 15:37:50 +00:00
ref : ${{ inputs.STACK_ORCHESTRATOR_REF }}
2022-06-02 11:59:44 +00:00
path : "./stack-orchestrator/"
repository : vulcanize/stack-orchestrator
- uses : actions/checkout@v2
with :
2022-06-17 15:37:50 +00:00
ref : ${{ inputs.GO_ETHEREUM_REF }}
2022-09-20 15:52:06 +00:00
repository : cerc-io/go-ethereum
2022-06-02 11:59:44 +00:00
path : "./go-ethereum/"
- uses : actions/checkout@v2
with :
2022-06-17 16:48:50 +00:00
ref : ${{ inputs.IPLD_ETH_DB_REF }}
2022-09-20 15:52:06 +00:00
repository : cerc-io/ipld-eth-db
2022-06-02 11:59:44 +00:00
path : "./ipld-eth-db/"
- name : Create config file
run : |
echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ >> ./config.sh
echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh
echo vulcanize_test_contract=$GITHUB_WORKSPACE/ipld-eth-server/test/contract >> ./config.sh
2022-07-12 08:10:45 +00:00
echo genesis_file_path=start-up-files/go-ethereum/genesis.json >> ./config.sh
2022-06-02 11:59:44 +00:00
echo db_write=$DB_WRITE >> ./config.sh
echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh
echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh
echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh
cat ./config.sh
- name : Build geth
run : |
cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts
./compile-geth.sh \
-p "$GITHUB_WORKSPACE/config.sh" \
-e docker
- name : Run docker compose
run : |
docker-compose \
2022-06-17 15:37:50 +00:00
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" \
2022-06-02 11:59:44 +00:00
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-contract.yml" \
--env-file "$GITHUB_WORKSPACE/config.sh" \
up -d --build
- name : Test
run : |
cd $GITHUB_WORKSPACE/ipld-eth-server
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \
make integrationtest
integrationtest_forwardethcalls :
name : Run integration tests for direct proxy fall-through of eth_calls
env :
GOPATH : /tmp/go
DB_WRITE : false
ETH_FORWARD_ETH_CALLS : true
ETH_PROXY_ON_ERROR : false
ETH_HTTP_PATH : "go-ethereum:8545"
runs-on : ubuntu-latest
steps :
2023-03-31 14:48:41 +00:00
- uses : actions/checkout@v2
- name : Set up Go
uses : actions/setup-go@v4
with :
go-version : 1.19 .7
2022-06-02 11:59:44 +00:00
- name : Create GOPATH
run : mkdir -p /tmp/go
- uses : actions/checkout@v2
with :
path : "./ipld-eth-server"
- uses : actions/checkout@v2
with :
2022-06-17 15:37:50 +00:00
ref : ${{ inputs.STACK_ORCHESTRATOR_REF }}
2022-06-02 11:59:44 +00:00
path : "./stack-orchestrator/"
repository : vulcanize/stack-orchestrator
- uses : actions/checkout@v2
with :
2022-06-17 15:37:50 +00:00
ref : ${{ inputs.GO_ETHEREUM_REF }}
2022-09-20 15:52:06 +00:00
repository : cerc-io/go-ethereum
2022-06-02 11:59:44 +00:00
path : "./go-ethereum/"
- uses : actions/checkout@v2
with :
2022-06-17 16:48:50 +00:00
ref : ${{ inputs.IPLD_ETH_DB_REF }}
2022-09-20 15:52:06 +00:00
repository : cerc-io/ipld-eth-db
2022-06-02 11:59:44 +00:00
path : "./ipld-eth-db/"
- name : Create config file
run : |
echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ >> ./config.sh
echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh
echo vulcanize_test_contract=$GITHUB_WORKSPACE/ipld-eth-server/test/contract >>./config.sh
2022-07-12 08:10:45 +00:00
echo genesis_file_path=start-up-files/go-ethereum/genesis.json >> ./config.sh
2022-06-02 11:59:44 +00:00
echo db_write=$DB_WRITE >> ./config.sh
echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh
echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh
echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh
cat ./config.sh
- name : Build geth
run : |
cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts
./compile-geth.sh \
-p "$GITHUB_WORKSPACE/config.sh" \
-e docker
- name : Run docker compose
run : |
docker-compose \
2022-06-17 15:37:50 +00:00
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" \
2022-06-02 11:59:44 +00:00
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-contract.yml" \
--env-file "$GITHUB_WORKSPACE/config.sh" \
up -d --build
- name : Test
run : |
cd $GITHUB_WORKSPACE/ipld-eth-server
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \
make integrationtest