1
- name : " Continuous integration"
1
+ name : ' Continuous integration'
2
2
3
3
on : [push, pull_request]
4
4
5
5
env :
6
6
PIP_CACHE_DIR : ${{ github.workspace }}/.cache/pip
7
7
POETRY_CACHE_DIR : ${{ github.workspace }}/.cache/pypoetry
8
- DEFAULT_PYTHON : " 3.8"
8
+ DEFAULT_PYTHON : ' 3.8'
9
9
10
10
jobs :
11
11
test :
12
- name : " Test Python ${{ matrix.python-version }} on ${{ matrix.os }}"
12
+ name : ' Test Python ${{ matrix.python-version }} on ${{ matrix.os }}'
13
13
runs-on : ${{ matrix.os }}-latest
14
14
strategy :
15
15
matrix :
16
16
os : [Ubuntu, Windows, macOS]
17
- python-version : ["3.6", "3.7", " 3.8", " 3.9", " 3.10" ]
17
+ python-version : ['3.7', ' 3.8', ' 3.9', ' 3.10' ]
18
18
steps :
19
- - name : " Check out repository"
19
+ - name : ' Check out repository'
20
20
uses : actions/checkout@v3
21
21
22
- - name : " Set up Python"
22
+ - name : ' Set up Python'
23
23
uses : actions/setup-python@v4
24
24
with :
25
25
python-version : ${{ matrix.python-version }}
26
26
27
- - name : " Set up dependency cache"
27
+ - name : ' Set up dependency cache'
28
28
uses : actions/cache@v3
29
29
# poetry venv restore is buggy on windows
30
30
# https://github.com/python-poetry/poetry/issues/2629
@@ -35,89 +35,89 @@ jobs:
35
35
${{ env.PIP_CACHE_DIR }}
36
36
${{ env.POETRY_CACHE_DIR }}
37
37
38
- - name : " Install poetry"
38
+ - name : ' Install poetry'
39
39
run : pip install "poetry==1.1.11"
40
40
41
- - name : " Install dependencies"
41
+ - name : ' Install dependencies'
42
42
run : poetry install
43
43
44
- - name : " Run tests"
44
+ - name : ' Run tests'
45
45
run : poetry run coverage run --branch --source=decoy -m pytest --mypy-same-process
46
46
47
- - name : " Generate coverage report"
47
+ - name : ' Generate coverage report'
48
48
run : poetry run coverage xml
49
49
50
- - name : " Upload coverage report"
50
+ - name : ' Upload coverage report'
51
51
uses : codecov/codecov-action@v3
52
52
53
53
check :
54
- name : " Lint and type checks"
54
+ name : ' Lint and type checks'
55
55
runs-on : ubuntu-latest
56
56
steps :
57
- - name : " Check out repository"
57
+ - name : ' Check out repository'
58
58
uses : actions/checkout@v3
59
59
60
- - name : " Set up Python"
60
+ - name : ' Set up Python'
61
61
uses : actions/setup-python@v4
62
62
with :
63
63
python-version : ${{ env.DEFAULT_PYTHON }}
64
64
65
- - name : " Set up dependency cache"
65
+ - name : ' Set up dependency cache'
66
66
uses : actions/cache@v3
67
67
with :
68
68
key : deps-${{ secrets.GH_CACHE }}-${{ runner.os }}-python${{ env.DEFAULT_PYTHON }}-${{ hashFiles('**/*.lock') }}
69
69
path : |
70
70
${{ env.PIP_CACHE_DIR }}
71
71
${{ env.POETRY_CACHE_DIR }}
72
72
73
- - name : " Install poetry"
73
+ - name : ' Install poetry'
74
74
run : pip install "poetry==1.1.11"
75
75
76
- - name : " Install dependencies"
76
+ - name : ' Install dependencies'
77
77
run : poetry install
78
78
79
- - name : " Check formatting"
79
+ - name : ' Check formatting'
80
80
run : poetry run black --check .
81
81
82
- - name : " Check linter"
82
+ - name : ' Check linter'
83
83
run : poetry run flake8
84
84
85
- - name : " Checks types"
85
+ - name : ' Checks types'
86
86
run : poetry run mypy
87
87
88
88
build :
89
89
name : Build assets and deploy on tags
90
90
runs-on : ubuntu-latest
91
91
needs : [test, check]
92
92
steps :
93
- - name : " Check out repository"
93
+ - name : ' Check out repository'
94
94
uses : actions/checkout@v3
95
95
96
- - name : " Set up Python"
96
+ - name : ' Set up Python'
97
97
uses : actions/setup-python@v4
98
98
with :
99
99
python-version : ${{ env.DEFAULT_PYTHON }}
100
100
101
- - name : " Set up dependency cache"
101
+ - name : ' Set up dependency cache'
102
102
uses : actions/cache@v3
103
103
with :
104
104
key : deps-${{ secrets.GH_CACHE }}-${{ runner.os }}-python${{ env.DEFAULT_PYTHON }}-${{ hashFiles('**/*.lock') }}
105
105
path : |
106
106
${{ env.PIP_CACHE_DIR }}
107
107
${{ env.POETRY_CACHE_DIR }}
108
108
109
- - name : " Install poetry"
109
+ - name : ' Install poetry'
110
110
run : pip install "poetry==1.1.11"
111
111
112
- - name : " Install dependencies"
112
+ - name : ' Install dependencies'
113
113
run : poetry install
114
114
115
- - name : " Build artifacts"
115
+ - name : ' Build artifacts'
116
116
run : |
117
117
poetry build
118
118
poetry run mkdocs build
119
119
120
- - name : " Deploy to PyPI and GitHub Pages"
120
+ - name : ' Deploy to PyPI and GitHub Pages'
121
121
if : startsWith(github.ref, 'refs/tags/v')
122
122
env :
123
123
USER_NAME : ${{ github.actor }}
0 commit comments