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.

71 lines
2.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  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: Translate Repo Name For Build Tools filename_prefix
  11. id: repo-name
  12. run: |
  13. echo ::set-output name=repo-name::$(
  14. echo ${{ github.repository }} |
  15. awk -F '\/' '{ print tolower($2) }' |
  16. tr '_' '-'
  17. )
  18. - name: Set up Python 3.7
  19. uses: actions/setup-python@v4
  20. with:
  21. python-version: 3.7
  22. - name: Versions
  23. run: |
  24. python3 --version
  25. - name: Checkout Current Repo
  26. uses: actions/checkout@v3
  27. with:
  28. submodules: true
  29. - name: Checkout tools repo
  30. uses: actions/checkout@v3
  31. with:
  32. repository: adafruit/actions-ci-circuitpython-libs
  33. path: actions-ci
  34. - name: Install dependencies
  35. # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
  36. run: |
  37. source actions-ci/install.sh
  38. - name: Pip install Sphinx, pre-commit
  39. run: |
  40. pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
  41. - name: Library version
  42. run: git describe --dirty --always --tags
  43. - name: Setup problem matchers
  44. uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
  45. - name: Pre-commit hooks
  46. run: |
  47. pre-commit run --all-files
  48. - name: Build assets
  49. run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
  50. - name: Archive bundles
  51. uses: actions/upload-artifact@v2
  52. with:
  53. name: bundles
  54. path: ${{ github.workspace }}/bundles/
  55. - name: Build docs
  56. working-directory: docs
  57. run: sphinx-build -E -W -b html . _build/html
  58. - name: Check For pyproject.toml
  59. id: need-pypi
  60. run: |
  61. echo pyproject-toml=$( find . -wholename './pyproject.toml' ) >> $GITHUB_OUTPUT
  62. - name: Build Python package
  63. if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
  64. run: |
  65. pip install --upgrade build setuptools wheel twine readme_renderer testresources
  66. find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/1.2.3/" {} +
  67. python -m build
  68. twine check dist/*