-
Notifications
You must be signed in to change notification settings - Fork 37
75 lines (69 loc) · 2.47 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
name: Continuous integration
on: [push]
jobs:
runner-job:
runs-on: ubuntu-latest
strategy:
matrix:
django: ["django==4.2.16", "django==5.0.9", "django==5.1.2"]
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: "frontend/package-lock.json"
- name: Install javascript packages
working-directory: ./frontend
run: npm clean-install --audit=false --fund=false --loglevel=http
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install python packages
run: pip install ${{ matrix.django }} && pip install -r testproject/requirements.txt && pip install -r testproject/requirements_test.txt && pip install -r testproject/requirements_ci.txt && pip install -e .
- name: Run django check
run: python testproject/manage.py check
- name: Check migrations
run: python testproject/manage.py makemigrations django_file_form --check --noinput --verbosity=1
env:
CHECK_MIGRATIONS: true
- name: Build javascript
working-directory: ./frontend
run: npm run build
- name: Javascript test
working-directory: ./frontend
run: npm run test
- name: Create javascript coverage directory
run: mkdir js_coverage
- name: Test with coverage
run: COVERAGE=true coverage run --source=django_file_form,testproject/django_file_form_example testproject/manage.py test django_file_form_example -v 2
- name: Merge Python coverage
run: coverage report && coverage lcov
- name: Merge javascript coverage
working-directory: ./coverage
run: npm clean-install --audit=false --fund=false --loglevel=http && npm run merge_coverage
- name: Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true