-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (43 loc) · 1.34 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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