Repository navigation
Require Python 3.11 and validate the contributor build #151
This file contains hidden or 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
| name: Package Check | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: package-check-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| package-check-python: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install test and distribution tooling | |
| run: python -m pip install -e ".[dev,test]" | |
| - name: Run unit tests | |
| run: python -m pytest -q tests/unit | |
| - name: Build distributions | |
| run: python -m build | |
| - name: Validate distributions | |
| run: python -m twine check dist/* | |
| - name: Install and smoke-test wheel | |
| run: | | |
| python -m venv "$RUNNER_TEMP/package-check" | |
| "$RUNNER_TEMP/package-check/bin/pip" install --upgrade pip | |
| "$RUNNER_TEMP/package-check/bin/pip" install dist/*.whl | |
| "$RUNNER_TEMP/package-check/bin/python" -I -c "import socketdev; from socketdev.version import __version__; print('wheel smoke OK', __version__)" | |
| - name: Upload distributions | |
| if: matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: socketdev-${{ github.sha }} | |
| path: dist/* | |
| if-no-files-found: error | |
| retention-days: 14 | |
| package-check: | |
| if: always() | |
| needs: package-check-python | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require all Python versions to pass | |
| env: | |
| RESULT: ${{ needs.package-check-python.result }} | |
| run: test "$RESULT" = success |