|
1 |
| -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries |
| 1 | +# SPDX-FileCopyrightText: 2023 Jose D. Montoya |
2 | 2 | #
|
3 |
| -# SPDX-License-Identifier: MIT |
| 3 | +# SPDX-License-Identifier: Unlicense |
4 | 4 |
|
5 | 5 | name: Build CI
|
6 | 6 |
|
7 |
| -on: [pull_request, push] |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + types: [opened, reopened] |
| 10 | + push: |
8 | 11 |
|
9 | 12 | jobs:
|
10 |
| - test: |
| 13 | + build-wheel: |
11 | 14 | runs-on: ubuntu-latest
|
12 | 15 | steps:
|
13 |
| - - name: Run Build CI workflow |
14 |
| - uses: jposada202020/workflows-circuitpython-libs/build@main |
| 16 | + - uses: actions/setup-python@v4 |
| 17 | + with: |
| 18 | + python-version: "3.x" |
| 19 | + |
| 20 | + - uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Build wheel |
| 23 | + run: pip wheel -w dist --no-deps . |
| 24 | + |
| 25 | + - name: check dist |
| 26 | + run: pipx run twine check dist/* |
| 27 | + |
| 28 | + - name: Archive wheel |
| 29 | + uses: actions/upload-artifact@v3 |
| 30 | + with: |
| 31 | + name: wheel |
| 32 | + path: ${{ github.workspace }}/dist/ |
| 33 | + |
| 34 | + linters: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + |
| 38 | + - uses: actions/setup-python@v4 |
| 39 | + with: |
| 40 | + python-version: "3.x" |
| 41 | + |
| 42 | + - uses: actions/checkout@v3 |
| 43 | + |
| 44 | + - name: Install pre-commit and deps |
| 45 | + run: pip install pre-commit -r requirements.txt |
| 46 | + |
| 47 | + - name: Setup problem matchers |
| 48 | + uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 |
| 49 | + |
| 50 | + - name: Pre-commit hooks |
| 51 | + run: pre-commit run --all-files |
| 52 | + |
| 53 | + build-bundles: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - name: Translate Repo Name For Build Tools filename_prefix |
| 57 | + id: repo-name |
| 58 | + run: | |
| 59 | + echo repo-name=$( |
| 60 | + echo ${{ github.repository }} | |
| 61 | + awk -F '\/' '{ print tolower($2) }' | |
| 62 | + tr '_' '-' |
| 63 | + ) >> $GITHUB_OUTPUT |
| 64 | +
|
| 65 | + - uses: actions/checkout@v3 |
| 66 | + |
| 67 | + - name: Set up Python 3.x |
| 68 | + uses: actions/setup-python@v4 |
| 69 | + with: |
| 70 | + python-version: "3.x" |
| 71 | + |
| 72 | + - name: Checkout tools repo |
| 73 | + uses: actions/checkout@v3 |
| 74 | + with: |
| 75 | + repository: adafruit/actions-ci-circuitpython-libs |
| 76 | + path: actions-ci |
| 77 | + |
| 78 | + - name: Install deps |
| 79 | + run: | |
| 80 | + source actions-ci/install.sh |
| 81 | +
|
| 82 | + - name: Build assets |
| 83 | + run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . |
| 84 | + |
| 85 | + - name: Archive bundles |
| 86 | + uses: actions/upload-artifact@v3 |
| 87 | + with: |
| 88 | + name: bundles |
| 89 | + path: ${{ github.workspace }}/bundles/ |
| 90 | + |
| 91 | + build-docs: |
| 92 | + runs-on: ubuntu-latest |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v3 |
| 95 | + |
| 96 | + - name: Set up Python 3.x |
| 97 | + uses: actions/setup-python@v4 |
| 98 | + with: |
| 99 | + python-version: "3.x" |
| 100 | + |
| 101 | + - name: Install deps |
| 102 | + run: | |
| 103 | + pip install -r docs/requirements.txt -r requirements.txt |
| 104 | +
|
| 105 | + - name: Build docs |
| 106 | + working-directory: docs |
| 107 | + run: sphinx-build -E -W -b html . _build/html |
| 108 | + |
| 109 | + - name: Archive docs |
| 110 | + uses: actions/upload-artifact@v3 |
| 111 | + with: |
| 112 | + name: docs |
| 113 | + path: ${{ github.workspace }}/docs/_build/html |
0 commit comments