]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blob - .github/workflows/build.yml
Pin Python to version 3.7, same as Blinka
[hackapet/Adafruit_Blinka_Displayio.git] / .github / workflows / build.yml
1 # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2 # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries
3 #
4 # SPDX-License-Identifier: MIT
5
6 name: Build CI
7
8 on: [pull_request, push]
9
10 jobs:
11   test:
12     runs-on: ubuntu-latest
13     steps:
14     - name: Dump GitHub context
15       env:
16         GITHUB_CONTEXT: ${{ toJson(github) }}
17       run: echo "$GITHUB_CONTEXT"
18     - name: Translate Repo Name For Build Tools filename_prefix
19       id: repo-name
20       run: |
21         echo "repo-name=Adafruit-Blinka-displayio" >> $GITHUB_OUTPUT
22     - name: Set up Python 3.7
23       uses: actions/setup-python@v4
24       with:
25         python-version: "3.7"
26     - name: Versions
27       run: |
28         python3 --version
29     - name: Checkout Current Repo
30       uses: actions/checkout@v3
31       with:
32         submodules: true
33     - name: Checkout tools repo
34       uses: actions/checkout@v3
35       with:
36         repository: adafruit/actions-ci-circuitpython-libs
37         path: actions-ci
38     - name: Install dependencies
39       # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
40       run: |
41         source actions-ci/install.sh
42     - name: Pip install Sphinx, pre-commit
43       run: |
44         pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
45     - name: Library version
46       run: git describe --dirty --always --tags
47     - name: Setup problem matchers
48       uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
49     - name: Pre-commit hooks
50       run: |
51         pre-commit run --all-files
52     - name: Build docs
53       working-directory: docs
54       run: sphinx-build -E -W -b html . _build/html
55     - name: Check For pyproject.toml
56       id: need-pypi
57       run: |
58         echo "pyproject-toml=$( find . -wholename './pyproject.toml' )" >> $GITHUB_OUTPUT
59     - name: Build Python package
60       if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
61       run: |
62         pip install --upgrade build twine
63         for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
64             sed -i -e "s/0.0.0+auto.0/1.2.3/" $file;
65         done;
66         python -m build
67         twine check dist/*