This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
119 lines (115 loc) · 3.29 KB
/
continuous-integration.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Continuous Integration
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
jobs:
test_node:
name: Node CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- name: Install Node Dependencies
run: npm ci
- name: Run Tests
run: npm test
test_python:
name: Python CI
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: donate
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
# Update these for tests on github!
ALLOWED_HOSTS: localhost
CONTENT_TYPE_NO_SNIFF: True
DATABASE_URL: postgres://postgres:postgres@localhost:5432/donate
DEBUG: False
DJANGO_SECRET_KEY: secret
SET_HSTS: False
SLACK_WEBHOOK_PONTOON: ${{ secrets.SLACK_WEBHOOK_PONTOON }}
SSL_REDIRECT: False
USE_S3: False
X_FRAME_OPTIONS: DENY
XSS_PROTECTION: True
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
cache: 'pip'
- uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- name: Install Python Dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
- name: Run Tests
run: |
flake8 donate/
coverage run --source './donate' ./manage.py test --settings=donate.settings --configuration=Testing
test_integration:
name: Integration testing
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: donate
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
# Update these for tests on github!
ALLOWED_HOSTS: localhost
CONTENT_TYPE_NO_SNIFF: True
DATABASE_URL: postgres://postgres:postgres@localhost:5432/donate
DEBUG: False
DJANGO_SECRET_KEY: secret
SET_HSTS: False
SLACK_WEBHOOK_PONTOON: ${{ secrets.SLACK_WEBHOOK_PONTOON }}
SSL_REDIRECT: False
USE_S3: False
X_FRAME_OPTIONS: DENY
XSS_PROTECTION: True
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
cache: 'pip'
- uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- name: Install Python Dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
- name: Install Node Dependencies
run: npm ci
- name: Install additional tooling
run: |
sudo apt-get install -y gettext libgconf-2-4
- name: Install Playwrightx
run: npm run playwright:install
- name: Preroll
run: |
npm run build
python manage.py collectstatic --no-input --verbosity 0
python manage.py migrate --no-input
python manage.py load_fake_data
- name: Integration Tests
run: npm run playwright:ci