File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,23 @@ name: Django CI
3
3
on :
4
4
push :
5
5
branches : [ master ]
6
- pull_request :
7
- branches : [ master ]
8
6
9
7
jobs :
10
8
build :
11
9
12
10
runs-on : ubuntu-latest
11
+ services :
12
+ postgres : # we need a postgres docker image to be booted a side car service to run the tests that needs a db
13
+ image : postgres
14
+ env : # the environment variable must match with app/settings.py if block of DATBASES variable otherwise test will fail due to connectivity issue.
15
+ POSTGRES_USER : postgres
16
+ POSTGRES_PASSWORD : postgres
17
+ POSTGRES_DB : github-actions
18
+ ports :
19
+ - 5432:5432 # exposing 5432 port for application to use
20
+ # needed because the postgres container does not provide a healthcheck
21
+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
22
+
13
23
strategy :
14
24
max-parallel : 4
15
25
matrix :
25
35
run : |
26
36
python -m pip install --upgrade pip
27
37
pip install -r requirements.txt
38
+ - name : Lint with flake8
39
+ run : |
40
+ pip install flake8
41
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
28
43
- name : Run Tests
29
44
run : |
30
45
python manage.py test
You can’t perform that action at this time.
0 commit comments