Skip to content

Commit

Permalink
ci: cibuildwheel action test
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Dec 21, 2020
1 parent 41f56ef commit b3dc8a9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
28 changes: 28 additions & 0 deletions .github/actions/cibuildwheel/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'cibuildwheel'
description: 'Runs cibuildwheel on the current runner'
inputs:
package-dir:
description: 'Input directory, defaults to "."'
required: false
default: '.'
output-dir:
description: 'Folder to place the outputs in, defaults to "wheelhouse"'
required: false
default: 'wheelhouse'
artifact:
description: 'Upload/merge wheels into the given artifact if not blank'
required: false
default: 'artifact'

runs:
using: "composite"
steps:
- run: pip install cibuildwheel==1.7.1
shell: bash
- run: python -m cibuildwheel ${{ inputs.package-dir }} --output_dir ${{ inputs.output-dir }}
shell: bash
- uses: actions/upload-artifact@v2
if: "${{ inputs.artifact }} != ''"
with:
path: wheelhouse/*
name: ${{ inputs.artifact }}
20 changes: 7 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ jobs:
with:
submodules: true

# TODO: unpin after 2.2.0 gets fixed. PyPy is broken in 2.2.0.
- uses: actions/[email protected]
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -81,29 +80,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v1
with:
submodules: true

- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.5.5 twine
- uses: actions/setup-python@v2

- name: Build wheel
run: python -m cibuildwheel --output-dir wheelhouse
- uses: ./.github/actions/cibuildwheel
env:
CIBW_BUILD: cp38-win_amd64 cp27-manylinux_i686 cp37-macosx_x86_64
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_BUILD_VERBOSITY: 1

- name: Check wheels
run: twine check wheelhouse/*
run: |
python -m pip install twine
twine check wheelhouse/*
shell: bash

0 comments on commit b3dc8a9

Please sign in to comment.