-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (46 loc) · 1.78 KB
/
build.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Python CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false # Allow one of the matrix builds to fail without failing others
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
# The job
name: Python ${{ matrix.python-version }}
# The steps in the job. Each step either RUNS code, or USES an action
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Run tests and linting
run: |
sudo apt-get install pandoc -y
pip install pip jupyter matplotlib pytest black wheel setuptools twine flake8 --quiet --upgrade
pip install . # Install the package
black . --check -l 120 --exclude="_version.py"
flake8 streprogen --select=F811,F841,F401,E711,E712,E731
pytest streprogen --doctest-modules --color=yes # Run tests
pytest docs/examples --verbose --doctest-modules --color=yes # Run test_notebooks.py
pip install -r docs/requirements.txt
sphinx-build docs docs/_build -v
# ======================= BUILD WHEELS AND UPLOAD TO PYPI ==================================
- name: Build package ${{ matrix.python-version }}
run: |
python setup.py sdist bdist_wheel;
- name: Publish Python distribution to PyPI
if: github.ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
user: __token__
password: ${{ secrets.pypi_password }}