]> Repositories - Adafruit_Blinka-hackapet.git/blob - .github/workflows/build.yml
black using python 3.7 style
[Adafruit_Blinka-hackapet.git] / .github / workflows / build.yml
1 name: Build CI
2
3 on: [pull_request, push]
4
5 jobs:
6   test:
7     runs-on: ubuntu-latest
8     steps:
9     - name: Dump GitHub context
10       env:
11         GITHUB_CONTEXT: ${{ toJson(github) }}
12       run: echo "$GITHUB_CONTEXT"
13     - name: Translate Repo Name For Build Tools filename_prefix
14       id: repo-name
15       run: echo ::set-output name=repo-name::Adafruit-Blinka
16     - name: Set up Python 3.7
17       uses: actions/setup-python@v1
18       with:
19         python-version: 3.7
20     - name: Versions
21       run: |
22         python3 --version
23     - name: Checkout Current Repo
24       uses: actions/checkout@v2
25       with:
26         submodules: true
27     - name: Checkout tools repo
28       uses: actions/checkout@v2
29       with:
30         repository: adafruit/actions-ci-circuitpython-libs
31         path: actions-ci
32     - name: Install dependencies
33       # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
34       run: |
35         source actions-ci/install.sh
36     - name: Pip install pylint, black, & Sphinx
37       run: |
38         pip install --force-reinstall pylint==2.7.1 black Sphinx sphinx-rtd-theme
39     - name: Library version
40       run: git describe --dirty --always --tags
41     - name: Check formatting
42       run: |
43         black --check --target-version=py37 .
44     - name: PyLint
45       run: |
46         pylint $( find src -name '*.py' )
47         ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
48     - name: Build docs
49       working-directory: docs
50       run: sphinx-build -E -W -b html . _build/html