Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only set CIBW testing env vars if workflow input is given #127

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@ jobs:
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Configure cibuildwheel
shell: bash
run: |
if [ -n "${{ inputs.test_extras }}" ];
then
echo "CIBW_TEST_EXTRAS=${{ inputs.test_extras }}" >> $GITHUB_ENV
fi
if [ -n "${{ inputs.test_command }}" ];
then
echo "CIBW_TEST_COMMAND=${{ inputs.test_command }}" >> $GITHUB_ENV
fi
cat $GITHUB_ENV
- uses: actions/setup-python@v4
if: ${{ inputs.env != '' }}
with:
Expand All @@ -164,8 +176,6 @@ jobs:
env:
CIBW_BUILD: ${{ matrix.CIBW_BUILD }}
CIBW_ARCHS: ${{ matrix.CIBW_ARCHS }}
CIBW_TEST_EXTRAS: ${{ inputs.test_extras }}
CIBW_TEST_COMMAND: ${{ inputs.test_command }}
- uses: actions/upload-artifact@v3
with:
path: dist/*
Expand Down
2 changes: 2 additions & 0 deletions docs/source/publish.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ test_extras

Any ``extras_requires`` modifier that should be used to install the
package for testing. Default is none.
If not set, cibuildwheel will use any ``test-extras`` configured in ``pyproject.toml``.

test_command
^^^^^^^^^^^^

The command to run to test the package. Will be run in a temporary
directory. Default is no testing.
If not set, cibuildwheel will use any ``test-command`` configured in ``pyproject.toml``.

env
^^^
Expand Down