1+ name : Upload Python Package
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ jobs :
8+ build :
9+
10+ runs-on : ubuntu-latest
11+ strategy :
12+ matrix :
13+ python-version : [3.6, 3.7, 3.8, 3.9]
14+
15+ steps :
16+ - uses : actions/checkout@v2
17+ - name : Set up Python ${{ matrix.python-version }}
18+ uses : actions/setup-python@v2
19+ with :
20+ python-version : ${{ matrix.python-version }}
21+ - name : Install dependencies
22+ run : |
23+ python -m pip install --upgrade pip
24+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25+ if [ -f dev-requirements.txt ]; then pip install -r dev-requirements.txt; fi
26+ - name : Lint with flake8, black, isort, pydocstyle
27+ run : |
28+ flake8 bashplot/ --count --statistic
29+ black . --check -v
30+ isort . --check -v
31+ flake8 . --count --exit-zero --max-complexity=10 --statistics
32+ pydocstyle --convention=numpy -e bashplot/bashplot.py
33+ - name : Install bashplot
34+ run : |
35+ pip install .
36+ - name : Test with pytest and coverage
37+ run : |
38+ coverage run -m pytest -vv
39+ coverage report -m
40+ coverage xml
41+ - name : Codecov
42+ uses : codecov/codecov-action@v1
43+ with :
44+ token : ${{ secrets.CODECOV_TOKEN }}
45+ env_vars : OS,PYTHON
46+ deploy :
47+
48+ runs-on : ubuntu-latest
49+ needs : build
50+ steps :
51+ - uses : actions/checkout@v2
52+ - name : Set up Python
53+ uses : actions/setup-python@v2
54+ with :
55+ python-version : ' 3.x'
56+ - name : Install dependencies
57+ run : |
58+ python -m pip install --upgrade pip
59+ pip install setuptools wheel twine
60+ - name : Build and publish
61+ env :
62+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
63+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
64+ run : |
65+ python setup.py sdist bdist_wheel
66+ twine upload dist/*
0 commit comments