-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (76 loc) · 2.32 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: unittest
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test-gws:
runs-on: ubuntu-latest
services:
gplates-postgis:
image: gplates/postgis
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name gplates-postgis
ports:
- 5432:5432
gws-redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name gws-redis
ports:
- 6379:6379
steps:
-
name: Check out repository code
uses: actions/checkout@v4
-
name: Prepare DB
run: |
cd test
gunzip crustal_thickness.sql.gz
docker cp crustal_thickness.sql gplates-postgis:/tmp
docker cp setup-db.sh gplates-postgis:/tmp
docker exec gplates-postgis /tmp/setup-db.sh
-
name: Run GWS
run: |
cp django/GWS/env.template django/GWS/.env
docker run -d --name gws -v `pwd`:/gws --network ${{ job.container.network }} -p 18000:80 gplates/gws
docker exec gws pmm download all /gws/django/GWS/data/model-repo/
docker exec gws mkdir -p /gws/log
docker exec gws chown www-data:www-data -R /gws/log
docker exec gws service apache2 start
-
name: Sleep for 30 seconds
run: sleep 30s
shell: bash
-
name: Check gws docker container
if: always()
run: |
wget http://localhost:18000/reconstruct/reconstruct_points/?lons=95,142&lats=54,-33&time=140
docker ps
docker network ls
docker inspect gws -f "{{json .NetworkSettings.Networks }}"
-
name: Run testcases
run: |
docker run --name test -v`pwd`:/workspace --network ${{ job.container.network }} --env GWS_SERVER_URL=http://gws:80 gplates/gws /workspace/test/test-server.sh && ls -l && cat ./test/testcases/unittest-logs/*
-
name: Check log
if: always()
run: |
docker exec gws cat /var/log/apache2/error.log