| 
 | 1 | +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries  | 
 | 2 | +#  | 
 | 3 | +# SPDX-License-Identifier: MIT  | 
 | 4 | + | 
1 | 5 | name: Build CI  | 
2 | 6 | 
 
  | 
3 | 7 | on: [pull_request, push]  | 
@@ -38,20 +42,36 @@ jobs:  | 
38 | 42 |       # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)  | 
39 | 43 |       run: |  | 
40 | 44 |         source actions-ci/install.sh  | 
41 |  | -    - name: Pip install pylint, black, & Sphinx  | 
 | 45 | +    - name: Pip install pylint, Sphinx, pre-commit  | 
42 | 46 |       run: |  | 
43 |  | -        pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme  | 
 | 47 | +        pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit  | 
44 | 48 |     - name: Library version  | 
45 | 49 |       run: git describe --dirty --always --tags  | 
46 |  | -    - name: Check formatting  | 
 | 50 | +    - name: Pre-commit hooks  | 
47 | 51 |       run: |  | 
48 |  | -        black --check --target-version=py35 .  | 
 | 52 | +        pre-commit run --all-files  | 
49 | 53 |     - name: PyLint  | 
50 | 54 |       run: |  | 
51 | 55 |         pylint $( find . -path './simpleio.py' )  | 
52 | 56 |         ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))  | 
53 | 57 |     - name: Build assets  | 
54 | 58 |       run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .  | 
 | 59 | +    - name: Archive bundles  | 
 | 60 | +      uses: actions/upload-artifact@v2  | 
 | 61 | +      with:  | 
 | 62 | +        name: bundles  | 
 | 63 | +        path: ${{ github.workspace }}/bundles/  | 
55 | 64 |     - name: Build docs  | 
56 | 65 |       working-directory: docs  | 
57 | 66 |       run: sphinx-build -E -W -b html . _build/html  | 
 | 67 | +    - name: Check For setup.py  | 
 | 68 | +      id: need-pypi  | 
 | 69 | +      run: |  | 
 | 70 | +        echo ::set-output name=setup-py::$( find . -wholename './setup.py' )  | 
 | 71 | +    - name: Build Python package  | 
 | 72 | +      if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')  | 
 | 73 | +      run: |  | 
 | 74 | +        pip install --upgrade setuptools wheel twine readme_renderer testresources  | 
 | 75 | +        python setup.py sdist  | 
 | 76 | +        python setup.py bdist_wheel --universal  | 
 | 77 | +        twine check dist/*  | 
0 commit comments