-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (74 loc) · 2.15 KB
/
django.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI/CD
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
name: "Run tests"
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: ./.github/actions/setup-python
- name: Set up Node
uses: ./.github/actions/setup-node
- name: Collect static assets
run: |
npm run build
python manage.py collectstatic --noinput
- name: Check for missing migrations
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DJANGO_SETTINGS_MODULE: settings.test
run: |
python manage.py makemigrations --dry-run --check
- name: Run tests
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DJANGO_SETTINGS_MODULE: settings.test
run: |
make test
- name: Report code coverage
uses: codecov/codecov-action@v1
lint:
name: "Lint and static checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: ./.github/actions/setup-python
- name: Run linter
run: |
black --check .
docs:
name: "Build documentation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Set up Python
uses: ./.github/actions/setup-python
- name: Build documentation
run: make clean-docs build-docs
- name: Publish documentation to Github Pages
if: ${{ github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build