-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 1.7 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
name: 🔮 CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: config.settings.dev
VIRTUAL_ENV: .venv
PGPORT: 5432
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
services:
postgres:
# Docker Hub image
image: postgres:15-alpine
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: 🐘 Non-durable PostgreSQL
run: |
psql <<SQL
ALTER SYSTEM SET fsync=off;
ALTER SYSTEM SET synchronous_commit=off;
ALTER SYSTEM SET full_page_writes=off;
SQL
docker kill --signal=SIGHUP ${{ job.services.postgres.id }}
env:
PGPASSWORD: password
PGHOST: localhost
PGUSER: postgres
- uses: actions/[email protected]
- name: 💾 Create a database to check migrations
run: |
psql <<SQL
CREATE DATABASE pilotage_django;
SQL
env:
PGPASSWORD: password
PGHOST: localhost
PGUSER: postgres
- name: 💂 Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: requirements/dev.txt
- name: 📥 Install Python dependencies
run: |
make venv
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
- name: ✨ Verify quality
run: make quality