-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (77 loc) · 2.18 KB
/
ci.yaml
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
name: CI
# run on all pushes, pull requests to master, and allow manual runs
on:
push:
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install
run: |
pip install pycodestyle pytest pytest-cov sphinx sphinx_rtd_theme
pip install .
- name: Style check
run: find . -name "*.py" -exec pycodestyle --ignore E501,W503 {} +
docs:
runs-on: ubuntu-latest
# only run when tests succeed on the master branch
needs: test
# run on master branch or tags
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
architecture: x64
- name: Install
run: |
pip install pycodestyle pytest pytest-cov sphinx sphinx_rtd_theme
pip install .
- name: Build
run: |
make -C docs/ html
touch docs/_build/html/.nojekyll
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
pypi:
runs-on: ubuntu-latest
needs: [test, docs]
# run on tags
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
architecture: x64
- name: Build
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Deploy
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}