1616 GITHUB_BOT_USERNAME : github-actions[bot]
1717 GITHUB_BOT_EMAIL : 41898282+github-actions[bot]@users.noreply.github.com
1818 PY_COLORS : 1
19+ MYPY_FORCE_COLOR : 1
20+ PANDOC_VERSION : ' 3.1.6.2'
1921
2022jobs :
21- lint :
23+ code-quality :
2224 name : Lint code and check type hints
2325 runs-on : ubuntu-latest
2426 steps :
2527 - uses : actions/checkout@v3
2628 with :
2729 fetch-depth : 0
28- - name : Set up Python 3.8
29- uses : actions/setup- python@v4
30+ - name : Setup Python 3.8
31+ uses : ./.github/ actions/python
3032 with :
31- python-version : 3.8
32- cache : ' pip'
33- - name : Install Dev Requirements
34- run : pip install -r requirements-dev.txt
35- - name : Cache Tox Directory for Linting
36- uses : actions/cache@v3
33+ python_version : 3.8
34+ - uses : actions/cache@v3
3735 with :
38- key : tox-${{ github.ref }}-${{ runner.os }}-${{ hashFiles('tox.ini') }}
39- path : .tox
36+ path : ~/.cache/pre-commit
37+ key : pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}
4038 - name : Lint Code
41- run : tox -e linting
39+ run : |
40+ pre-commit run --all --show-diff-on-failure
41+ python build_scripts/run_pylint.py | (pylint-json2html -f jsonextended -o pylint.html)
42+ shell : bash
4243 - name : Check Type Hints
43- run : tox -e type-checking
44+ run : mypy src/
4445 docs :
4546 name : Build Docs
4647 runs-on : ubuntu-latest
4748 steps :
4849 - uses : actions/checkout@v3
4950 with :
5051 fetch-depth : 0
51- - name : Set up Python 3.8
52- uses : actions/setup- python@v4
52+ - name : Setup Python 3.8
53+ uses : ./.github/ actions/python
5354 with :
54- python-version : 3.8
55- cache : ' pip'
56- - name : Install Dev Requirements
57- run : pip install -r requirements-dev.txt
55+ python_version : 3.8
5856 - name : Install Pandoc
59- run : sudo apt-get install --no-install-recommends --yes pandoc
60- - name : Cache Tox Directory for Docs
61- uses : actions/cache@v3
57+ uses : r-lib/actions/setup-pandoc@v2
6258 with :
63- key : tox-${{ github.ref }}-${{ runner.os }}-${{ hashFiles('tox.ini') }}
64- path : .tox
59+ pandoc-version : ${{ env.PANDOC_VERSION }}
6560 - name : Build Docs
66- run : tox -e docs
67- - name : Save built docs
68- uses : actions/upload-artifact@v3
69- with :
70- name : docs
71- path : ./docs/_build
72- retention-days : 1
61+ run : mkdocs build
7362 base-tests :
7463 strategy :
7564 matrix :
7968 with :
8069 tests_to_run : base
8170 python_version : ${{ matrix.python_version }}
82- needs : [lint ]
71+ needs : [code-quality ]
8372 torch-tests :
8473 strategy :
8574 matrix :
8978 with :
9079 tests_to_run : torch
9180 python_version : ${{ matrix.python_version }}
92- needs : [lint ]
81+ needs : [code-quality ]
9382 notebook-tests :
9483 strategy :
9584 matrix :
@@ -99,50 +88,41 @@ jobs:
9988 with :
10089 tests_to_run : notebooks
10190 python_version : ${{ matrix.python_version }}
102- needs : [lint ]
91+ needs : [code-quality ]
10392 push-docs-and-release-testpypi :
10493 name : Push Docs and maybe release Package to TestPyPI
10594 runs-on : ubuntu-latest
10695 needs : [docs, base-tests, torch-tests, notebook-tests]
96+ if : ${{ github.ref == 'refs/heads/develop' }}
10797 concurrency :
108- group : push-docs-and-release-testpypi
98+ group : publish
10999 steps :
110100 - uses : actions/checkout@v3
111101 with :
112102 fetch-depth : 0
113- - name : Set up Python 3.8
114- uses : actions/setup-python@v4
115- with :
116- python-version : 3.8
117- cache : ' pip'
118- - name : Install Dev Requirements
119- run : pip install -r requirements-dev.txt
120- - name : Cache Tox Directory
121- uses : actions/cache@v3
103+ - name : Setup Python 3.8
104+ uses : ./.github/actions/python
122105 with :
123- key : tox-${{ github.ref }}-${{ runner.os }}-${{ hashFiles('tox.ini') }}
124- path : .tox
125- - name : Download built docs
126- uses : actions/download-artifact@v3
106+ python_version : 3.8
107+ - name : Install Pandoc
108+ uses : r-lib/actions/setup-pandoc@v2
127109 with :
128- name : docs
129- path : ./docs/_build
110+ pandoc-version : ${{ env.PANDOC_VERSION }}
130111 - name : Deploy Docs
131- uses : peaceiris/actions-gh-pages@v3
132- if : ${{ github.ref == 'refs/heads/develop' }}
112+ uses : ./.github/actions/deploy-docs
133113 with :
134- github_token : ${{ secrets.GITHUB_TOKEN }}
135- publish_dir : ./docs/_build/html
136- user_name : ${{ env.GITHUB_BOT_USERNAME }}
137- user_email : ${{ env.GITHUB_BOT_EMAIL }}
114+ version : devel
115+ alias : develop
116+ title : Development
117+ email : ${{ env.GITHUB_BOT_EMAIL }}
118+ username : ${{ env.GITHUB_BOT_USERNAME }}
138119 - name : Build and publish to TestPyPI
139- if : ${{ github.ref == 'refs/heads/develop' }}
140120 env :
141121 TWINE_USERNAME : __token__
142122 TWINE_PASSWORD : ${{ secrets.TEST_PYPI_PASSWORD }}
143123 run : |
144124 set -x
145- export CURRENT_VERSION=$(python setup.py --version)
146125 export BUILD_NUMBER=$GITHUB_RUN_NUMBER
147- tox -e bump-dev-version
148- tox -e publish-test-package
126+ bump2version --no-tag --no-commit --verbose --serialize '\{major\}.\{minor\}.\{patch\}.\{release\}\{$BUILD_NUMBER\}' boguspart
127+ python setup.py sdist bdist_wheel
128+ twine upload -r testpypi --verbose --non-interactive dist/*
0 commit comments