-
Notifications
You must be signed in to change notification settings - Fork 68
48 lines (46 loc) · 1.49 KB
/
main.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
name: test
on:
schedule:
- cron: '0 5 * * 0'
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: create project
run: |
pip install django
django-admin startproject --template="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/zipball/$GITHUB_REF_NAME" --extension=py,rst,gitignore,cfg,in,yml,json,dockerignore --name=Makefile,Dockerfile testproj
- name: mock client build
run: |
mkdir -p client/dist
touch client/dist/index.js
working-directory: testproj
- name: start services
run: |
docker compose up -d
# wait for migrations to finish
docker attach $(docker compose ps -q django-migrate)
timeout-minutes: 5
working-directory: testproj
- name: verify services running
run: |
docker ps # show service status for debugging
test $(docker ps -q | wc -l) = "2"
- name: verify website running
run: |
curl -I --retry 10 --retry-connrefused --fail localhost:8000/testproj-admin/login/
- name: verify client build
run: |
curl -I --retry 10 --retry-connrefused --fail localhost:8000/static/index.js
- name: dump docker logs
run: |
set -x
docker compose ps
docker compose logs
working-directory: testproj
if: always()