forked from CSCfi/fairdata-metax-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.46 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
name: Django CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
POSTGRES_USER: postgres
POSTGRES_PASS: postgres
POSTGRES_DATABASE_NAME: github_actions
jobs:
build:
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Install Dependencies
run: |
poetry lock --no-update
poetry install --no-root
- name: Run migrations
run: |
source .venv/bin/activate
python manage.py migrate
- name: Run Tests
run: |
source .venv/bin/activate
pytest -n 2 --ff