You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.4 KiB

  1. # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
  2. #
  3. # SPDX-License-Identifier: MIT
  4. name: Build CI
  5. on: [pull_request, push]
  6. jobs:
  7. test:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Dump GitHub context
  11. env:
  12. GITHUB_CONTEXT: ${{ toJson(github) }}
  13. run: echo "$GITHUB_CONTEXT"
  14. - name: Translate Repo Name For Build Tools filename_prefix
  15. id: repo-name
  16. run: |
  17. echo ::set-output name=repo-name::$(
  18. echo ${{ github.repository }} |
  19. awk -F '\/' '{ print tolower($2) }' |
  20. tr '_' '-'
  21. )
  22. - name: Set up Python 3.7
  23. uses: actions/setup-python@v1
  24. with:
  25. python-version: 3.7
  26. - name: Versions
  27. run: |
  28. python3 --version
  29. - name: Checkout Current Repo
  30. uses: actions/checkout@v1
  31. with:
  32. submodules: true
  33. - name: Checkout tools repo
  34. uses: actions/checkout@v2
  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: Pre-commit hooks
  48. run: |
  49. pre-commit run --all-files
  50. - name: Build assets
  51. run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
  52. - name: Archive bundles
  53. uses: actions/upload-artifact@v2
  54. with:
  55. name: bundles
  56. path: ${{ github.workspace }}/bundles/
  57. - name: Build docs
  58. working-directory: docs
  59. run: sphinx-build -E -W -b html . _build/html
  60. - name: Check For setup.py
  61. id: need-pypi
  62. run: |
  63. echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
  64. - name: Build Python package
  65. if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
  66. run: |
  67. pip install --upgrade setuptools wheel twine readme_renderer testresources
  68. python setup.py sdist
  69. python setup.py bdist_wheel --universal
  70. twine check dist/*
  71. - name: Setup problem matchers
  72. uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1