@@ -3,30 +3,241 @@ name: Python package
33on : [push]
44
55jobs :
6- build :
6+ PEP8 :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - uses : actions/checkout@v2
10+ - name : Set up Python
11+ uses : actions/setup-python@v2
12+ with :
13+ python-version : ' 3.x'
14+ - name : Install dependencies
15+ run : |
16+ python -m pip install --upgrade pip
17+ pip install --upgrade -r flake8_requirements.txt
18+ - name : Lint with flake8
19+ run : |
20+ flake8 threaded
21+
22+ PyLint :
23+ runs-on : ubuntu-latest
24+ steps :
25+ - uses : actions/checkout@v2
26+ - name : Set up Python
27+ uses : actions/setup-python@v2
28+ with :
29+ python-version : ' 3.8'
30+ - name : Install dependencies
31+ run : |
32+ python -m pip install --upgrade pip
33+ pip install --upgrade -r CI_REQUIREMENTS.txt
34+ pip install --upgrade "pylint >= 2.6.0"
35+ - name : Generate version file
36+ run : |
37+ python setup.py --version clean
38+ - name : Lint with PyLint
39+ run : |
40+ pylint threaded
41+
42+ MyPy :
43+ runs-on : ubuntu-latest
44+ steps :
45+ - uses : actions/checkout@v2
46+ - name : Set up Python
47+ uses : actions/setup-python@v2
48+ with :
49+ python-version : ' 3.x'
50+ - name : Install dependencies
51+ run : |
52+ python -m pip install --upgrade pip
53+ pip install --upgrade -r CI_REQUIREMENTS.txt
54+ pip install --upgrade "mypy >= 0.790"
55+ - name : Generate version file
56+ run : |
57+ python setup.py --version clean
58+ - name : Lint with MyPy
59+ run : |
60+ mypy --strict threaded
61+
62+ Black :
63+ runs-on : ubuntu-latest
64+ steps :
65+ - uses : actions/checkout@v2
66+ - name : Set up Python
67+ uses : actions/setup-python@v2
68+ with :
69+ python-version : ' 3.x'
70+ - name : Install dependencies
71+ run : |
72+ python -m pip install --upgrade pip
73+ pip install --upgrade black regex
74+ - name : Check code style with black
75+ run : |
76+ black --check threaded
777
78+ TestScript :
79+ needs : [PEP8, PyLint, MyPy, Black]
880 runs-on : ${{ matrix.os }}
981 strategy :
10- max-parallel : 4
82+ max-parallel : 8
1183 matrix :
1284 os : [ubuntu-latest, windows-latest]
13- python-version : [3.6, 3.7]
14-
15- steps :
16- - uses : actions/checkout@v1
17- - name : Set up Python ${{ matrix.python-version }}
18- uses : actions/setup-python@v1
19- with :
20- python-version : ${{ matrix.python-version }}
21- - name : Install dependencies
22- run : |
23- python -m pip install --upgrade pip wheel
24- pip install -r CI_REQUIREMENTS.txt
25- pip install --upgrade pytest pytest-sugar pytest-cov
26- - name : Build package and install develop
27- run : |
28- python setup.py develop -v
29- - name : Test with pytest
30- run : |
31- py.test --cov-config .coveragerc --cov-report= --cov=threaded test
32- coverage report -m --fail-under 90
85+ python-version : [3.6, 3.7, 3.8, 3.9]
86+
87+ name : " Script based python ${{ matrix.python-version }} on ${{ matrix.os }}"
88+ steps :
89+ - uses : actions/checkout@v2
90+ - name : Set up Python ${{ matrix.python-version }}
91+ uses : actions/setup-python@v2
92+ with :
93+ python-version : ${{ matrix.python-version }}
94+ - name : Install dependencies
95+ run : |
96+ python -m pip install --upgrade pip wheel
97+ pip install --upgrade -r CI_REQUIREMENTS.txt
98+ pip install --upgrade -r pytest_requirements.txt
99+ - name : Build package and install develop
100+ run : |
101+ python setup.py develop -v clean
102+ - name : Test with pytest
103+ run : |
104+ py.test --cov-report= --cov=threaded test
105+ coverage report -m --fail-under 85
106+
107+ TestLinux :
108+ needs : [TestScript]
109+ runs-on : ubuntu-latest
110+ strategy :
111+ max-parallel : 4
112+ matrix :
113+ python-version : [3.6, 3.7, 3.8, 3.9]
114+ name : " Cython based python ${{ matrix.python-version }} on linux"
115+
116+ steps :
117+ - uses : actions/checkout@v2
118+ - name : Set up Python ${{ matrix.python-version }}
119+ uses : actions/setup-python@v2
120+ with :
121+ python-version : ${{ matrix.python-version }}
122+ - name : Install dependencies
123+ run : |
124+ python -m pip install --upgrade pip wheel
125+ pip install --upgrade -r CI_REQUIREMENTS.txt
126+ pip install --upgrade Cython
127+ pip install --upgrade -r pytest_requirements.txt
128+ - name : Build package and install
129+ run : |
130+ python setup.py bdist_wheel clean
131+ pip install threaded --no-index -f dist
132+ - name : Test with pytest
133+ run : |
134+ py.test
135+
136+ TestWindows :
137+ needs : [TestScript]
138+ runs-on : windows-latest
139+ strategy :
140+ max-parallel : 8
141+ matrix :
142+ WINDOWS :
143+ - { ARCH: 'x86', WINDOWS: 'win32' }
144+ - { ARCH: 'x64', WINDOWS: 'win64' }
145+ python-version : [3.6, 3.7, 3.8, 3.9]
146+ name : " Cython based python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
147+
148+ steps :
149+ - uses : actions/checkout@v2
150+ - name : Set up Python ${{ matrix.python-version }}
151+ uses : actions/setup-python@v2
152+ with :
153+ python-version : ${{ matrix.python-version }}
154+ architecture : ${{ matrix.WINDOWS.ARCH }}
155+ - name : Install dependencies
156+ run : |
157+ python -m pip install --upgrade pip wheel
158+ pip install --upgrade -r CI_REQUIREMENTS.txt
159+ pip install --upgrade Cython
160+ pip install --upgrade -r pytest_requirements.txt
161+ - name : Build package and install
162+ run : |
163+ python setup.py bdist_wheel clean
164+ pip install threaded --no-index -f dist
165+ - name : Test with pytest
166+ run : |
167+ py.test
168+
169+ DeployWindows :
170+ needs : [TestLinux, TestWindows]
171+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
172+ runs-on : windows-latest
173+ strategy :
174+ max-parallel : 6
175+ matrix :
176+ WINDOWS :
177+ - { ARCH: 'x86', WINDOWS: 'win32' }
178+ - { ARCH: 'x64', WINDOWS: 'win64' }
179+ python-version : [3.7, 3.8, 3.9]
180+ name : " Release for python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
181+
182+ steps :
183+ - uses : actions/checkout@v2
184+ - name : Set up Python ${{ matrix.python-version }}
185+ uses : actions/setup-python@v2
186+ with :
187+ python-version : ${{ matrix.python-version }}
188+ architecture : ${{ matrix.WINDOWS.ARCH }}
189+ - name : Install dependencies
190+ run : |
191+ python -m pip install --upgrade pip wheel
192+ pip install --upgrade -r build_requirements.txt
193+ pip install --upgrade twine
194+ - name : Build package
195+ run : |
196+ python setup.py sdist bdist_wheel clean
197+ - name : Deploy
198+ env :
199+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
200+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
201+ run : |
202+ twine upload --skip-existing dist/*
203+
204+ # DeployManyLinux:
205+ # needs: [ TestLinux, TestWindows ]
206+ # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
207+ # runs-on: ubuntu-latest
208+ # container:
209+ # image: ${{ matrix.MANYLINUX.CONTAINER }}
210+ # env:
211+ # PYTHONDONTWRITEBYTECODE: 1
212+ # strategy:
213+ # matrix:
214+ # PYTHON: [ "cp37-cp37m", "cp38-cp38", "cp39-cp39" ]
215+ # MANYLINUX:
216+ # - NAME: manylinux2010_x86_64
217+ # CONTAINER: "quay.io/pypa/manylinux2010_x86_64"
218+ # - NAME: manylinux2014_x86_64
219+ # CONTAINER: "quay.io/pypa/manylinux2014_x86_64"
220+ # name: "${{ matrix.PYTHON }} for ${{ matrix.MANYLINUX.NAME }}"
221+ # steps:
222+ # - uses: actions/checkout@v2
223+ # - name: Install main dependencies
224+ # run: |
225+ # /opt/python/${{ matrix.PYTHON }}/bin/python -m pip install -U pip wheel setuptools
226+ # /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade -r build_requirements.txt
227+ # /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade twine
228+ # - name: Build package
229+ # run: /opt/python/${{ matrix.PYTHON }}/bin/python setup.py bdist_wheel clean
230+ # - name: Bundle external shared libraries into the wheels
231+ # run: |
232+ # for whl in dist/*.whl; do
233+ # echo "Repairing $whl..."
234+ # auditwheel repair "$whl" -w dist/
235+ # done
236+ # - name: Cleanup OS specific wheels
237+ # run: rm -fv dist/*-linux_*.whl
238+ # - name: Deploy
239+ # env:
240+ # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
241+ # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
242+ # run: |
243+ # twine upload --skip-existing dist/*
0 commit comments