1
1
name : Build
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
4
8
5
9
jobs :
6
10
checks :
7
- name : Lint, typing, coverage
8
- runs-on : ubuntu-latest
11
+ name : Lint, typing, security
12
+ runs-on : ubuntu-18.04
9
13
10
14
steps :
11
15
- uses : actions/checkout@v2
12
16
13
17
- name : Set up Python 3.8
14
- uses : actions/setup-python@v1
18
+ uses : actions/setup-python@v2
15
19
with :
16
20
python-version : 3.8
17
21
@@ -27,16 +31,12 @@ jobs:
27
31
- name : Black
28
32
run : tox -e black
29
33
30
- - name : Generate coverage report
31
- run : tox -e py
32
-
33
- - name : Upload coverage report
34
- run : bash <(curl -s https://codecov.io/bash)
35
-
34
+ - name : Bandit
35
+ run : tox -e bandit
36
36
37
37
tests-ubuntu :
38
38
name : " Test: py${{ matrix.python-version }}, Ubuntu"
39
- runs-on : ubuntu-latest
39
+ runs-on : ubuntu-18.04
40
40
strategy :
41
41
matrix :
42
42
python-version : [3.6, 3.7, 3.8]
45
45
- uses : actions/checkout@v2
46
46
47
47
- name : Set up Python ${{ matrix.python-version }}
48
- uses : actions/setup-python@v1
48
+ uses : actions/setup-python@v2
49
49
with :
50
50
python-version : ${{ matrix.python-version }}
51
51
55
55
- name : Run tests
56
56
run : tox -e py
57
57
58
+ - name : Upload coverage report
59
+ run : bash <(curl -s https://codecov.io/bash)
60
+
58
61
tests-other-os :
59
62
name : " Test: py3.8, ${{ matrix.os }}"
60
63
runs-on : " ${{ matrix.os }}"
66
69
- uses : actions/checkout@v2
67
70
68
71
- name : Set up Python 3.8
69
- uses : actions/setup-python@v1
72
+ uses : actions/setup-python@v2
70
73
with :
71
74
python-version : 3.8
72
75
@@ -76,18 +79,17 @@ jobs:
76
79
- name : Run tests
77
80
run : tox -e py
78
81
79
-
80
82
publish :
81
83
name : " Publish package to PyPI"
82
- runs-on : ubuntu-latest
84
+ runs-on : ubuntu-18.04
83
85
needs : [checks, tests-ubuntu, tests-other-os]
84
86
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
85
87
86
88
steps :
87
89
- uses : actions/checkout@v2
88
90
89
91
- name : Set up Python 3.8
90
- uses : actions/setup-python@v1
92
+ uses : actions/setup-python@v2
91
93
with :
92
94
python-version : 3.8
93
95
0 commit comments