cleanup readme #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | ||
concurrency: | ||
group: ci-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
paths: | ||
- *.sh | ||
- *.sql | ||
- Dockerfile | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Build container | ||
run: | | ||
docker build -t chado . | ||
- name: Test Running Container | ||
run: | | ||
container_id=$(docker run -it -e INSTALL_YEAST_DATA=1 -d --name chado chado) | ||
while true; do | ||
date | ||
# Check that it's ready to run | ||
start_count=$(docker logs $container_id | grep 'database system is ready to accept connections' | wc -l) | ||
if (( start_count > 1 )); then | ||
break | ||
fi | ||
# If it's not output some logs | ||
docker logs $container_id | tail | ||
# And wait a bit | ||
sleep 5 | ||
done | ||
# Check that yeast is, in fact loaded. | ||
docker exec $container_id psql -U postgres -c "select * from organism where common_name = 'yeast' " | grep '1 row' | ||
# Dump something useful | ||
docker exec $container_id psql -U postgres -c "select type_id, count(*) from feature group by type_id ;" | ||
docker kill $container_id | ||
docker rm -f $container_id | ||
# Done! | ||
exit 0 |