|
| 1 | +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries |
| 2 | +# SPDX-FileCopyrightText: 2021 James Carr |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: MIT |
| 5 | + |
| 6 | +name: Build CI |
| 7 | + |
| 8 | +on: [pull_request, push] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-and-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: Set up Python 3.7 |
| 19 | + uses: actions/setup-python@v1 |
| 20 | + with: |
| 21 | + python-version: 3.7 |
| 22 | + - name: Versions |
| 23 | + run: | |
| 24 | + python3 --version |
| 25 | + - name: Checkout Current Repo |
| 26 | + uses: actions/checkout@v2 |
| 27 | + - name: Install requirements |
| 28 | + run: | |
| 29 | + sudo apt-get update |
| 30 | + sudo apt-get install libudev-dev libusb-1.0 |
| 31 | + sudo apt-get install -y gettext |
| 32 | + pip install -r requirements.txt |
| 33 | + - name: Library version |
| 34 | + run: git describe --dirty --always --tags |
| 35 | + - name: Install package locally |
| 36 | + run: pip install -e . |
| 37 | + - name: Test building single package |
| 38 | + run: | |
| 39 | + git clone https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git |
| 40 | + cd Adafruit_CircuitPython_FeatherWing |
| 41 | + circuitpython-build-bundles --filename_prefix test-single --library_location . |
| 42 | + - name: Test building bundle |
| 43 | + run: | |
| 44 | + # Use the community bundle because it's smaller and faster |
| 45 | + git clone --recurse-submodules https://github.com/adafruit/CircuitPython_Community_Bundle.git |
| 46 | + cd CircuitPython_Community_Bundle |
| 47 | + circuitpython-build-bundles --filename_prefix test-bundle --library_location libraries --library_depth 2 |
| 48 | + - name: Build Python package |
| 49 | + run: | |
| 50 | + pip install --upgrade setuptools wheel twine readme_renderer testresources |
| 51 | + python setup.py sdist |
| 52 | + twine check dist/* |
0 commit comments