1
+ name : Code Quality Checks
2
+ on : [push]
3
+ jobs :
4
+ run-tests :
5
+ runs-on : ubuntu-latest
6
+ steps :
7
+ # ----------------------------------------------
8
+ # check-out repo and set-up python
9
+ # ----------------------------------------------
10
+ - name : Check out repository
11
+ uses : actions/checkout@v2
12
+ - name : Set up python
13
+ id : setup-python
14
+ uses : actions/setup-python@v2
15
+ with :
16
+ python-version : 3.7
17
+ # ----------------------------------------------
18
+ # ----- install & configure poetry -----
19
+ # ----------------------------------------------
20
+ - name : Install Poetry
21
+ uses : snok/install-poetry@v1
22
+ with :
23
+ virtualenvs-create : true
24
+ virtualenvs-in-project : true
25
+ installer-parallel : true
26
+
27
+ # ----------------------------------------------
28
+ # load cached venv if cache exists
29
+ # ----------------------------------------------
30
+ - name : Load cached venv
31
+ id : cached-poetry-dependencies
32
+ uses : actions/cache@v2
33
+ with :
34
+ path : .venv
35
+ key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
36
+ # ----------------------------------------------
37
+ # install dependencies if cache does not exist
38
+ # ----------------------------------------------
39
+ - name : Install dependencies
40
+ if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
41
+ run : poetry install --no-interaction --no-root
42
+ # ----------------------------------------------
43
+ # install your root project, if required
44
+ # ----------------------------------------------
45
+ - name : Install library
46
+ run : poetry install --no-interaction
47
+ # ----------------------------------------------
48
+ # run test suite
49
+ # ----------------------------------------------
50
+ - name : Run tests
51
+ run : poetry run pytest tests/
52
+ check-linting :
53
+ runs-on : ubuntu-latest
54
+ steps :
55
+ # ----------------------------------------------
56
+ # check-out repo and set-up python
57
+ # ----------------------------------------------
58
+ - name : Check out repository
59
+ uses : actions/checkout@v2
60
+ - name : Set up python
61
+ id : setup-python
62
+ uses : actions/setup-python@v2
63
+ with :
64
+ python-version : 3.7
65
+ # ----------------------------------------------
66
+ # ----- install & configure poetry -----
67
+ # ----------------------------------------------
68
+ - name : Install Poetry
69
+ uses : snok/install-poetry@v1
70
+ with :
71
+ virtualenvs-create : true
72
+ virtualenvs-in-project : true
73
+ installer-parallel : true
74
+
75
+ # ----------------------------------------------
76
+ # load cached venv if cache exists
77
+ # ----------------------------------------------
78
+ - name : Load cached venv
79
+ id : cached-poetry-dependencies
80
+ uses : actions/cache@v2
81
+ with :
82
+ path : .venv
83
+ key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
84
+ # ----------------------------------------------
85
+ # install dependencies if cache does not exist
86
+ # ----------------------------------------------
87
+ - name : Install dependencies
88
+ if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
89
+ run : poetry install --no-interaction --no-root
90
+ # ----------------------------------------------
91
+ # install your root project, if required
92
+ # ----------------------------------------------
93
+ - name : Install library
94
+ run : poetry install --no-interaction
95
+ # ----------------------------------------------
96
+ # black the code
97
+ # ----------------------------------------------
98
+ - name : Black
99
+ run : poetry run black --check src
100
+
101
+ check-types :
102
+ runs-on : ubuntu-latest
103
+ steps :
104
+ # ----------------------------------------------
105
+ # check-out repo and set-up python
106
+ # ----------------------------------------------
107
+ - name : Check out repository
108
+ uses : actions/checkout@v2
109
+ - name : Set up python
110
+ id : setup-python
111
+ uses : actions/setup-python@v2
112
+ with :
113
+ python-version : 3.7
114
+ # ----------------------------------------------
115
+ # ----- install & configure poetry -----
116
+ # ----------------------------------------------
117
+ - name : Install Poetry
118
+ uses : snok/install-poetry@v1
119
+ with :
120
+ virtualenvs-create : true
121
+ virtualenvs-in-project : true
122
+ installer-parallel : true
123
+
124
+ # ----------------------------------------------
125
+ # load cached venv if cache exists
126
+ # ----------------------------------------------
127
+ - name : Load cached venv
128
+ id : cached-poetry-dependencies
129
+ uses : actions/cache@v2
130
+ with :
131
+ path : .venv
132
+ key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
133
+ # ----------------------------------------------
134
+ # install dependencies if cache does not exist
135
+ # ----------------------------------------------
136
+ - name : Install dependencies
137
+ if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
138
+ run : poetry install --no-interaction --no-root
139
+ # ----------------------------------------------
140
+ # install your root project, if required
141
+ # ----------------------------------------------
142
+ - name : Install library
143
+ run : poetry install --no-interaction
144
+ # ----------------------------------------------
145
+ # black the code
146
+ # ----------------------------------------------
147
+ - name : Mypy
148
+ run : poetry run mypy src
0 commit comments