-
Notifications
You must be signed in to change notification settings - Fork 23
101 lines (85 loc) · 2.35 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Python CI
on:
push:
branches: [master]
pull_request:
branches:
- '**'
workflow_dispatch:
branches:
- '**'
defaults:
run:
shell: bash # opts into error checking
jobs:
run_tests:
name: tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
python-version:
- '3.12'
toxenv: [py, quality]
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip
run: pip install -r requirements/pip.txt
- name: Install Dependencies
run: pip install -r requirements/ci.txt
- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
# Tests that used to be in the cookiecutter-django-ida Makefile but
# that have not yet been moved into the regular unit tests (which
# would require some more work.)
run_ida_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
python-version:
- '3.11'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Generate demo project
run: |
make requirements
cookiecutter cookiecutter-django-ida --no-input
- name: "Post-gen: Virtualenv, and set up requirements"
working-directory: repo_name
run: |
virtualenv .venv
source .venv/bin/activate
make upgrade # TODO should be part of initial cookiecutter setup
make requirements
- name: "Post-gen: Migrations"
working-directory: repo_name
run: |
source .venv/bin/activate
python manage.py makemigrations
make migrate
- name: "Quality checks"
working-directory: repo_name
run: |
source .venv/bin/activate
make validate
- name: "Ensure translations can be compiled"
working-directory: repo_name
run: |
source .venv/bin/activate
sudo apt install gettext # required for msguniq, called by makemessages management command
make fake_translations
- name: "Ensure docker can build a container"
working-directory: repo_name
run: |
source .venv/bin/activate
docker build . --target app