Skip to content

Commit

Permalink
infra: release rely on local built in testing (#28492)
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis authored Dec 4, 2024
1 parent bc5ec63 commit a009249
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ jobs:
poetry-version: ${{ env.POETRY_VERSION }}
working-directory: ${{ inputs.working-directory }}

- name: Import published package
- uses: actions/download-artifact@v4
with:
name: dist
path: ${{ inputs.working-directory }}/dist/

- name: Import dist package
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
Expand All @@ -208,15 +213,7 @@ jobs:
# - attempt install again after 5 seconds if it fails because there is
# sometimes a delay in availability on test pypi
run: |
poetry run pip install \
--extra-index-url https://test.pypi.org/simple/ \
"$PKG_NAME==$VERSION" || \
( \
sleep 15 && \
poetry run pip install \
--extra-index-url https://test.pypi.org/simple/ \
"$PKG_NAME==$VERSION" \
)
poetry run pip install dist/*.whl
# Replace all dashes in the package name with underscores,
# since that's how Python imports packages with dashes in the name.
Expand All @@ -225,20 +222,18 @@ jobs:
poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
- name: Import test dependencies
run: poetry install --with test
run: poetry install --with test --no-root
working-directory: ${{ inputs.working-directory }}

# Overwrite the local version of the package with the test PyPI version.
# Overwrite the local version of the package with the built version
- name: Import published package (again)
working-directory: ${{ inputs.working-directory }}
shell: bash
env:
PKG_NAME: ${{ needs.build.outputs.pkg-name }}
VERSION: ${{ needs.build.outputs.version }}
run: |
poetry run pip install \
--extra-index-url https://test.pypi.org/simple/ \
"$PKG_NAME==$VERSION"
poetry run pip install dist/*.whl
- name: Run unit tests
run: make tests
Expand Down

0 comments on commit a009249

Please sign in to comment.