-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (34 loc) · 1.06 KB
/
backend-dev.yml
File metadata and controls
42 lines (34 loc) · 1.06 KB
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
name: Backend CI
permissions:
contents: read
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
container_django: docker-ngen-django-1
steps:
- uses: actions/checkout@v3
- name: Build develop docker containers for Django backend
run: |
cd docker
cp .env/ngen.dev.env.example .env/ngen.dev.env
docker compose -f docker-compose-dev.yml build ngen-django
docker compose -f docker-compose-dev.yml up -d ngen-django
# Test if django container is running
max_retries=60
retries=0
while [[ "$(docker inspect -f '{{.State.Running}}' "$container_django")" != "true" ]]; do
retries=$((retries + 1))
if [ $retries -ge $max_retries ]; then
echo "Container '$container_django' did not start within the timeout."
exit 1
fi
sleep 1
done
- name: Run Django tests
run: docker exec "$container_django" ./manage.py test ngen.tests