2022-06-03 13:28:02 +00:00
name : Test the stack.
on :
workflow_call :
env :
2022-07-13 07:42:59 +00:00
STACK_ORCHESTRATOR_REF : "f2fd766f5400fcb9eb47b50675d2e3b1f2753702"
GO_ETHEREUM_REF : "v1.10.19-statediff-4.1.0-alpha" # Use the tag, we are going to download the bin not build it.
IPLD_ETH_DB_REF : "b59505eab252670c622b42ce60621e9747fb64f9"
2022-06-03 13:28:02 +00:00
jobs :
integrationtest :
name : Run integration tests
env :
GOPATH : /tmp/go
DB_WRITE : true
runs-on : ubuntu-latest
steps :
- name : Create GOPATH
run : mkdir -p /tmp/go
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- uses : actions/setup-go@v3
with :
go-version : ">=1.18.0"
check-latest : true
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- uses : actions/checkout@v2
with :
path : "./ipld-eth-db-validator"
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- uses : actions/checkout@v2
with :
ref : ${{ env.STACK_ORCHESTRATOR_REF }}
path : "./stack-orchestrator/"
repository : vulcanize/stack-orchestrator
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- uses : actions/checkout@v2
with :
2022-06-20 13:37:15 +00:00
ref : ${{ env.IPLD_ETH_DB_REF }}
repository : vulcanize/ipld-eth-db
path : "./ipld-eth-db/"
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- name : Create config file
run : |
echo vulcanize_test_contract=$GITHUB_WORKSPACE/ipld-eth-db-validator/test/contract >> ./config.sh
2022-06-20 13:37:15 +00:00
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ >> ./config.sh
2022-07-13 07:42:59 +00:00
echo genesis_file_path=start-up-files/go-ethereum/genesis.json >> ./config.sh
2022-06-03 13:28:02 +00:00
echo db_write=$DB_WRITE >> ./config.sh
cat ./config.sh
2022-07-13 07:42:59 +00:00
- name : Download Geth
2022-06-03 13:28:02 +00:00
run : |
cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts
2022-06-20 13:37:15 +00:00
wget https://github.com/vulcanize/go-ethereum/releases/download/${{env.GO_ETHEREUM_REF}}/geth-linux-amd64
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- name : Run docker compose
run : |
docker-compose \
2022-06-20 13:37:15 +00:00
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" \
2022-06-03 13:28:02 +00:00
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-contract.yml" \
--env-file "$GITHUB_WORKSPACE/config.sh" \
up -d --build
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- name : Run integration test.
run : |
cd $GITHUB_WORKSPACE/ipld-eth-db-validator
./scripts/run_integration_test.sh
unittest :
name : Run unit tests
runs-on : ubuntu-latest
steps :
- name : Create GOPATH
run : mkdir -p /tmp/go
2022-07-13 07:42:59 +00:00
2022-06-03 13:28:02 +00:00
- uses : actions/setup-go@v3
with :
go-version : ">=1.18.0"
check-latest : true
2022-07-13 07:42:59 +00:00
- name : Checkout code
uses : actions/checkout@v2
- name : Spin up database
2022-06-03 13:28:02 +00:00
run : |
2022-07-13 07:42:59 +00:00
docker-compose up -d
- name : Run unit tests
2022-06-03 13:28:02 +00:00
run : |
2022-07-13 07:42:59 +00:00
sleep 30
2022-06-20 08:50:14 +00:00
PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=password DATABASE_HOSTNAME=127.0.0.1 DATABASE_NAME=vulcanize_testing make test