-
Notifications
You must be signed in to change notification settings - Fork 68
65 lines (63 loc) · 2.04 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: test
on:
schedule:
- cron: '0 5 * * 0'
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: create project
run: |
pip install django
django-admin startproject \
--template=https://github.com/lincolnloop/django-layout/zipball/main \
--extension=py,md,gitignore,yaml,json,toml \
--name=Makefile,Dockerfile \
--exclude=.github \
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) = "3"
- name: verify website running
run: |
curl -I --retry 10 --retry-all-errors --fail localhost:8000/testproj-admin/login/
- name: verify client build
run: |
curl -I --retry 10 --retry-all-errors --fail localhost:8000/static/index.js
- name: run tests
run: docker compose run --rm app make test
working-directory: testproj
- name: verify README.md
run: docker compose run --rm --no-deps app cog --check README.md
working-directory: testproj
- name: lint code
run: docker compose run --rm --no-deps app make lint
working-directory: testproj
- name: format code
run: docker compose run --rm --no-deps app ruff format --check .
working-directory: testproj
- name: dump docker logs
run: |
set -x
docker compose ps
docker compose logs
working-directory: testproj
if: always()