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