This repository was archived by the owner on Jun 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (80 loc) · 2.36 KB
/
ci.yml
File metadata and controls
91 lines (80 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
on:
push:
branches:
- master
create:
tags:
jobs:
stylecheck:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- name: Install stylechecker
run: pip install flake8
- name: Run stylecheck
run: flake8 .
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
os: ['ubuntu-18.04']
steps:
- uses: actions/checkout@v1
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install nosetests
run: pip install nose # for code coverage: coverage
- name: Run tests
run: python setup.py nosetests --with-doctest
# want to run code coverage? Uncomment and change cover-min-percentage and cover-package
# run: python setup.py nosetests --with-doctest --with-coverage --cover-html --cover-html-dir=coverage --cover-package=YOUR_PACKAGE_NAME --cover-branches --cover-erase --cover-min-percentage=80
dist:
runs-on: ubuntu-18.04
if: github.event_name == 'create'
steps:
- uses: actions/checkout@v1
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- name: Install wheel package
run: pip install wheel
- name: Build wheel and source distribution
run: python setup.py sdist bdist_wheel
- name: Upload dist artifact
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
publish:
needs: [dist, test]
runs-on: ubuntu-18.04
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- name: Download dist
uses: actions/download-artifact@v1
with:
name: dist
- name: Install twine
run: pip install twine
- name: Upload to PyPI
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
run: twine upload dist/*