[pre-commit.ci] pre-commit autoupdate #257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A workflow to build + test PyPI sdist/bdist artifacts | |
# (but not publish, as this is tricky without continuous automatic version generation) | |
# | |
# Reference: | |
# - https://github.com/actions/checkout | |
# - https://github.com/actions/download-artifact | |
# - https://github.com/actions/setup-python | |
# - https://github.com/actions/upload-artifact | |
# - https://github.com/pypa/build | |
name: ci-wheels | |
on: [pull_request, push] | |
jobs: | |
build-artifacts: | |
name: "Build PyPI artifacts" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "Build sdist/bdist" | |
run: | | |
# ugrid-checks is a pure python package, so simply use pypa/build | |
pipx run build | |
- name: "Show sdist/bdist" | |
run: | | |
ls -l ${{ github.workspace }}/dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pypi-artifacts | |
path: ${{ github.workspace }}/dist | |
test-artifacts: | |
needs: [build-artifacts] | |
name: "Test bdist" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: pypi-artifacts | |
path: ${{ github.workspace }}/dist | |
- name: "Install and import bdist" | |
working-directory: ${{ github.workspace }}/dist | |
run: | | |
python -m pip install ugrid_checks-*.whl | |
python -c "import ugrid_checks; print(f'Successfully imported ugrid-checks-{ugrid_checks.__version__}')" | |
echo "All done 👍" |