-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from naveen521kk/wheels
Build Wheels using Github Actions
- Loading branch information
Showing
4 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build Wheels | ||
|
||
on: | ||
push: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build Wheels on ${{ matrix.os }}-${{ matrix.platform_id }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
# Ensure the wheels build even one fails. | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
python: [35, 36, 37, 38, 39] | ||
bitness: [32, 64] | ||
include: | ||
# Run 32 and 64 bit version in parallel for Linux and Windows | ||
- os: windows-latest | ||
bitness: 64 | ||
platform_id: win_amd64 | ||
- os: windows-latest | ||
bitness: 32 | ||
platform_id: win32 | ||
- os: ubuntu-latest | ||
bitness: 64 | ||
platform_id: manylinux_x86_64 | ||
- os: ubuntu-latest | ||
bitness: 32 | ||
platform_id: manylinux_i686 | ||
- os: macos-latest | ||
bitness: 64 | ||
platform_id: macosx_x86_64 | ||
exclude: | ||
- os: macos-latest | ||
bitness: 32 | ||
env: | ||
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | ||
CIBW_TEST_REQUIRES: pytest==4.* hypothesis==4.* | ||
CIBW_TEST_COMMAND: "bash {project}/tools/test_wheels.sh {project}" | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1 | ||
CIBW_MANYLINUX_I686_IMAGE: manylinux1 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v1.11.1.post1 | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
name: wheels-${{ runner.os }}-${{ matrix.platform_id }}-${{ matrix.python }} | ||
|
||
- name: Publish (Release) | ||
if: github.event_name == 'release' | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
pip install twine | ||
twine upload wheelhouse/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
*.pyc | ||
*# | ||
*.so | ||
*.pyd | ||
*~ | ||
build/ | ||
pyrsistent.egg-info/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
#test wheels in different directory | ||
set -e | ||
set -x | ||
package=$1 | ||
|
||
FILE_PATH="`dirname \"$0\"`" | ||
FILE_PATH="`( cd \"$FILE_PATH\" && pwd )`" | ||
if [ -z "$FILE_PATH" ] ; then | ||
exit 1 | ||
fi | ||
|
||
cd $TMP | ||
cp -r $package/tests mtests | ||
pytest -s mtests | ||
rm -r mtests | ||
cd $FILE_PATH |