Skip to content

Vendor and use packaging_legacy==23.0.post0 #334

Vendor and use packaging_legacy==23.0.post0

Vendor and use packaging_legacy==23.0.post0 #334

Workflow file for this run

name: Test
on: [push, pull_request]
concurrency:
group: >-
${{
github.workflow
}}-${{
github.ref_type
}}-${{
github.event.pull_request.number || github.sha
}}
cancel-in-progress: true
env:
dists-artifact-name: python-package-distributions
sdist-artifact-name-wildcard: pip-api-*.tar.gz
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
- name: Install tox
run: python -m pip install tox
- name: Run linting
run: python -m tox -e lint
build-sdist:
name: 📦 Build the source distribution
runs-on: ubuntu-latest
steps:
- name: Grab the src from GH
uses: actions/checkout@v3
- name: Install `pypa/build` PEP 517 front-end
run: python -m pip install 'build ~= 0.10.0'
- name: 📦 Build an sdist
run: python -m build --sdist
- name: Verify that the artifact with expected name got created
run: >-
ls -1
dist/${{ env.sdist-artifact-name-wildcard }}
- name: Store the distribution package
uses: actions/upload-artifact@v3
with:
name: ${{ env.dists-artifact-name }}
# NOTE: Exact expected file names are specified here
# NOTE: as a safety measure — if anything weird ends
# NOTE: up being in this dir or not all dists will be
# NOTE: produced, this will fail the workflow.
path: |
dist/${{ env.sdist-artifact-name-wildcard }}
retention-days: 15
build-matrix:
name: Build the test matrix
needs: lint
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
- name: Install tox
run: python -m pip install tox
- id: set-matrix
run: >-
echo "matrix=$(python generate_matrix.py)" >> "${GITHUB_OUTPUT}"
test:
name: ${{ matrix.toxenv }}
needs:
- build-matrix
- build-sdist
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
steps:
- name: Retrieve the project source from an sdist inside the GHA artifact
uses: re-actors/checkout-python-sdist@release/v1
with:
source-tarball-name: ${{ env.sdist-artifact-name-wildcard }}
workflow-artifact-name: ${{ env.dists-artifact-name }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: python -m pip install tox
- name: Run tests
run: python -m tox -e ${{ matrix.toxenv }}
check:
if: always()
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}