-
Notifications
You must be signed in to change notification settings - Fork 112
43 lines (39 loc) · 1.45 KB
/
pythonapp.yml
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
name: Python application
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
# work around a pip issue with extras_require: https://github.com/pypa/pip/issues/8323
python -m pip install -U "pip @ git+https://github.com/pypa/pip.git"
python -m pip install --upgrade pip
python -m pip install .[all]
python -m pip install nbmake==0.10 pytest-xdist line_profiler # add'l packages for notebook tests.
- name: Lint with flake8 for pull requests
if: github.event_name == 'pull_request'
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 .
- name: Test with pytest
run: |
pytest --log-cli-level=10
- name: Test notebooks.
run: |
pytest --log-cli-level=10 --nbmake examples --ignore=examples/verification
- name: Build a distribution if tagged
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
python setup.py sdist
- name: Publish a Python distribution to PyPI if tagged
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}