forked from Yuanpei-Intelligence/YPPF
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.07 KB
/
unittest.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
name: unittest
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure local json
run: >
cat local_json_template.json |
sed 's/\$DATABASE\$/yppf/g' |
sed 's/\$USER\$/root/g' |
sed 's/\$PASSWORD\$/secret/g' |
sed 's/\$HOST\$/mysql/g' >
local_json.json
cat local_json.json
- name: Start containers
run: |
docker-compose -f env/docker-compose.yml up -d --build
- name: Check host
run: |
docker ps -a
sleep 10
timeout 45s bash -c "while ! curl -Is localhost:8000; do
sleep 3
echo 'Failed to fetch web page.'
done" ||
"docker-compose -f env/docker-compose.yml logs && exit 1"
- name: Test
run: |
docker-compose -f env/docker-compose.yml run yppf conda run -n yppf python3 manage.py test