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 Apr 23, 2023
1 parent 16cd321 commit 105f856
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,13 @@ source distribution. By default, this is `ubuntu-latest`.
#### 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
A map of environment variables to be available when building and testing.
Expand Down

0 comments on commit 105f856

Please sign in to comment.