ipld-eth-server/.github/workflows/run_unit_test.sh
Michael fc0d7a6dd6
Cerc refactor (#193)
* cerc refactor waiting on unpublished dependencies

* cerc refactor updates for dependencies

* Describe imports got removed

* cleaning up more vulcanize refs in ci/cd

* another test lost Describe imports

* another test lost Describe imports... not caught in go build -a???

* more cerc-io migrations to utilize new git.vdb.to gitea instance

* switching back to github for running unit test

* first try at git.vdb.to as conatiner repository

* targeted tag was incomplete
2022-09-20 11:52:06 -04:00

30 lines
947 B
Bash
Executable File

#!/bin/bash
set -e
# Set up repo
start_dir=$(pwd)
temp_dir=$(mktemp -d)
cd $temp_dir
git clone -b $(cat /tmp/git_head_ref) "https://github.com/$(cat /tmp/git_repository).git"
cd ipld-eth-server
## Remove the branch and github related info. This way future runs wont be confused.
rm -f /tmp/git_head_ref /tmp/git_repository
# Spin up DB and run migrations
echo 'docker-compose up -d migrations ipld-eth-db'
docker-compose up -d migrations ipld-eth-db
trap "docker-compose down -v --remove-orphans; cd $start_dir ; rm -r $temp_dir" SIGINT SIGTERM ERR
sleep 30
# Remove old logs so there's no confusion, then run test
rm -f /tmp/test.log /tmp/return_test.txt
PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=password DATABASE_HOSTNAME=localhost DATABASE_NAME=vulcanize_testing make test > /tmp/test.log
echo $? > /tmp/return_test.txt
# Clean up
docker-compose down -v --remove-orphans
cd $start_dir
rm -fr $temp_dir