This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
124 lines (102 loc) · 3.33 KB
/
main.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
120
121
122
123
name: Django CI
on: push
jobs:
code:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: covid_portal
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --dev
- name: Static assets
run: |
pipenv run python manage.py sass profiles/static/scss/styles.scss profiles/static/css/
pipenv run python manage.py collectstatic --noinput -i scss
- name: Check format with black
run: |
pipenv run format --check
- name: Lint for style with flake8
run: |
pipenv run lint
- name: Check css
run: |
pipenv run css
- name: Generate coverage report
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/covid_portal
run: |
pipenv run coverage_test
- name: Generate coverage report
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/covid_portal
run: |
pipenv run coverage_report
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
services:
postgres:
image: postgres:11.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: covid_portal
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --dev
- name: Static assets
run: |
pipenv run python manage.py sass profiles/static/scss/styles.scss profiles/static/css/
pipenv run python manage.py collectstatic --noinput -i scss
- name: Pipenv check for security vulnerabilities
run: |
pipenv check
- name: Run test suite
run: |
pipenv run test
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/covid_portal