-
Notifications
You must be signed in to change notification settings - Fork 26
82 lines (73 loc) · 2.32 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
test:
name: 📋 Test
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: apps.guide.settings.test
DATABASE_URL: postgres://postgres:postgres@localhost/postgres # pragma: allowlist secret
SECRET_KEY: iamnotsosecret
ALLOWED_HOSTS: localhost
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.0 python -
- name: Install Python dependencies
run: poetry install
- name: System checks
run: poetry run python manage.py check
- name: Collect static
run: poetry run python manage.py collectstatic --noinput --clear
- name: Create cache table
run: poetry run python manage.py createcachetable
- name: Missing migrations
run: poetry run python manage.py makemigrations --check
- name: Mock static
run: mkdir ./apps/frontend/static && echo "{}" > ./apps/frontend/static/manifest.json
- name: Test
run: make test-coverage
check_python:
name: 🐍 Check Python (backend)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.0 python -
- name: Install Python dependencies
run: poetry install
- name: Lint
run: make lint-backend
check_node:
name: 👩🚀 Check Node (frontend)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install npm dependencies
run: npm ci
- name: Lint
run: npm run lint