Skip to content

Commit

Permalink
Only set CIBW testing env vars if workflow input is given
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorMacBride committed May 9, 2023
1 parent b7950b5 commit aef7f12
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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

0 comments on commit aef7f12

Please sign in to comment.