-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (36 loc) · 1 KB
/
build.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
name: build
# //TEMP we should probably filter a bit better here to not start the CI if
# - documentation changes
# - non impacting changes...
on:
push:
pull_request:
schedule:
- cron: "56 10 * * 1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: build
run: |
cd docker
docker-compose up -d --build
docker-compose logs --tail="all"
docker ps
- name: test
run: |
WEB_CONTAINER=$(docker ps --format "{{.Names}}" | grep web)
for i in $(seq 10); do
if docker exec -i "$WEB_CONTAINER" python manage.py check --database default &> /dev/null; then
DB_READY=1
break
fi
echo "Waiting for database..."
sleep 2
done
if [ -z "$DB_READY" ]; then
echo "Couldn\'t connect to the database."
exit 1
fi
docker exec -i "$WEB_CONTAINER" python manage.py test