Skip to content

Commit

Permalink
Merge branch 'main' into black-show-diff
Browse files Browse the repository at this point in the history
  • Loading branch information
tekktrik committed Jan 30, 2024
2 parents 847c480 + 551f16f commit 8cb04cc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 16 deletions.
33 changes: 21 additions & 12 deletions build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
python-version:
description: 'The version of Python to use in the CI'
required: true
default: '3.x'
default: '3.11'
package-prefix:
description: |
The prefix (or name) of your pacakge (if applicable) to use
Expand All @@ -27,7 +27,7 @@ runs:
awk -F '\/' '{ print tolower($2) }' |
tr '_' '-'
) >> $GITHUB_OUTPUT
- name: Set up Python 3.x
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
Expand Down Expand Up @@ -58,24 +58,29 @@ runs:
run: git describe --dirty --always --tags
- name: Setup problem matchers
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
- name: Pre-commit hooks
- name: Print pre-commit hook versions
shell: bash
run: |
pre-commit run --all-files --show-diff-on-failure
- name: Install pytest
shell: bash
run: pip install pytest
- name: Install dependencies
python actions-ci/print_precommit_versions.py
- name: Pre-commit hooks
shell: bash
run: |
pip install -r requirements.txt
pip install -r optional_requirements.txt
pre-commit run --all-files --show-diff-on-failure
- name: Run pytest
shell: bash
run: |
if [[ -d tests ]]; then
pip install .
pytest
pip install pytest
python -m pytest # This syntax adds the library to the path
fi
- name: Add the given package filename_prefix
id: package-prefix-arg
shell: bash
run: |
if [ "${{ inputs.package-prefix }}" == "" ]; then
echo prefix-arg="" >> $GITHUB_OUTPUT
else
echo prefix-arg="--package_folder_prefix ${{ inputs.package-prefix }}" >> $GITHUB_OUTPUT
fi
- name: Add the given package filename_prefix
id: package-prefix-arg
Expand Down Expand Up @@ -109,6 +114,10 @@ runs:
shell: bash
run: |
echo pyproject-toml=$( find . -wholename './pyproject.toml' ) >> $GITHUB_OUTPUT
- name: Check packaging information
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
shell: bash
run: python actions-ci/check_lib_packaging.py
- name: Build Python package
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
shell: bash
Expand Down
27 changes: 24 additions & 3 deletions release-gh/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ inputs:
python-version:
description: 'The version of Python to use in the CI'
required: true
default: '3.x'
default: '3.11'
package-prefix:
description: |
The prefix (or name) of your pacakge (if applicable) to use
for GitHub releases
required: true
default: ""
ignore-bundles:
description: |
A comma and space separated list of bundles to be skipped when building.
Valid options are py, mpy, example, and json. For example, to skip
building the MPY and example bundles, this field would be: mpy, example
required: true
default: ""
runs:
using: "composite"
steps:
Expand All @@ -33,7 +40,7 @@ runs:
awk -F '\/' '{ print tolower($2) }' |
tr '_' '-'
) >> $GITHUB_OUTPUT
- name: Set up Python 3.x
- name: Set up requested Python version
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
Expand Down Expand Up @@ -63,9 +70,23 @@ runs:
else
echo prefix-arg="--package_folder_prefix ${{ inputs.package-prefix }}" >> $GITHUB_OUTPUT
fi
- name: Add the given bundle ignores
id: ignore-bundles-arg
shell: bash
run: |
if [ "${{ inputs.ignore-bundles }}" == "" ]; then
echo ignore-bundles="" >> $GITHUB_OUTPUT
else
echo ignore-bundles='--ignore "${{ inputs.ignore-bundles }}"' >> $GITHUB_OUTPUT
fi
- name: Build assets
shell: bash
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . ${{ steps.package-prefix-arg.outputs.prefix-arg }}
run: |
circuitpython-build-bundles \
--filename_prefix ${{ steps.repo-name.outputs.repo-name }} \
--library_location . \
${{ steps.package-prefix-arg.outputs.prefix-arg }} \
${{ steps.ignore-bundles-arg.outputs.prefix-arg }}
- name: Upload Release Assets
uses: shogo82148/actions-upload-release-asset@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion release-pypi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
python-version:
description: 'The version of Python to use in the CI'
required: true
default: '3.x'
default: '3.11'
runs:
using: "composite"
steps:
Expand Down

0 comments on commit 8cb04cc

Please sign in to comment.