1
1
---
2
- name : Release
2
+ name : CI/CD
3
+
3
4
on : # yamllint disable-line rule:truthy
5
+ pull_request :
6
+ branches : [ "master", "main" ]
7
+ push :
8
+ branches : [ "master", "main" ]
4
9
release :
5
- types : [created ]
10
+ types : [published ]
6
11
7
12
jobs :
8
13
lint :
9
14
runs-on : ubuntu-latest
10
15
steps :
16
+
11
17
- uses : actions/checkout@v1
18
+
12
19
- name : Set up Python 3.9
13
20
uses : actions/setup-python@v1
14
21
with :
15
22
python-version : 3.9
23
+
16
24
- name : Install dependencies
17
25
run : |
18
26
python -m pip install --upgrade pip
19
27
pip install tox
28
+
20
29
- name : Black with tox
21
- run : tox -e black,isort,pylint
30
+ run : tox -e black
31
+
32
+ - name : Isort with tox
33
+ run : tox -e isort
34
+
35
+ - name : Pylint with tox
36
+ run : tox -e pylint
37
+
22
38
test :
23
39
runs-on : ubuntu-latest
24
40
strategy :
@@ -27,19 +43,24 @@ jobs:
27
43
python-version : [3.9]
28
44
dj-version : [django40]
29
45
steps :
46
+
30
47
- uses : actions/checkout@v1
48
+
31
49
- name : Set up Python ${{ matrix.python-version }}
32
50
uses : actions/setup-python@v1
33
51
with :
34
52
python-version : ${{ matrix.python-version }}
53
+
35
54
- name : Install dependencies
36
55
run : |
37
56
python -m pip install --upgrade pip
38
57
pip install tox
58
+
39
59
- name : Test with tox
40
60
run : |
41
61
PY_VERSION=${{ matrix.python-version }} &&
42
62
tox -e py${PY_VERSION//.}-${{ matrix.dj-version }}
63
+
43
64
- name : Upload coverage to Codecov
44
65
uses : codecov/codecov-action@v1
45
66
with :
@@ -48,11 +69,18 @@ jobs:
48
69
flags : unittests
49
70
name : ${{ matrix.python-version }}-${{ matrix.dj-version }}
50
71
yml : ./codecov.yml
51
- pip_package :
72
+
73
+ release :
74
+ name : Release
52
75
runs-on : ubuntu-latest
53
- needs : [test, lint]
76
+ timeout-minutes : 10
77
+ if : github.event_name == 'release'
78
+ needs :
79
+ - lint
80
+ - test
54
81
steps :
55
82
- uses : actions/checkout@v1
83
+
56
84
- name : Set up Python 3.9
57
85
uses : actions/setup-python@v1
58
86
with :
0 commit comments