/ .github / workflows / build.yml
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: |
16          echo ::set-output name=repo-name::$(
17          echo ${{ github.repository }} |
18          awk -F '\/' '{ print tolower($2) }' |
19          tr '_' '-'
20          )
21      - name: Set up Python 3.6
22        uses: actions/setup-python@v1
23        with:
24          python-version: 3.6
25      - name: Versions
26        run: |
27          python3 --version
28      - name: Checkout Current Repo
29        uses: actions/checkout@v1
30        with:
31          submodules: true
32      - name: Checkout tools repo
33        uses: actions/checkout@v2
34        with:
35          repository: adafruit/actions-ci-circuitpython-libs
36          path: actions-ci
37      - name: Install dependencies
38        # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
39        run: |
40          source actions-ci/install.sh
41      - name: Pip install pylint, black, & Sphinx
42        run: |
43          pip install pylint black==19.10b0 Sphinx sphinx-rtd-theme
44      - name: Library version
45        run: git describe --dirty --always --tags
46      - name: Check formatting
47        run: |
48          black --check --target-version=py35 .
49      - name: PyLint
50        run: |
51          pylint $( find . -path './adafruit*.py' )
52          ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
53      - name: Build assets
54        run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
55      - name: Build docs
56        working-directory: docs
57        run: sphinx-build -E -W -b html . _build/html