Skip to content

Commit

Permalink
ci: use GHA for alternate archs
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Nov 19, 2020
1 parent 66fa370 commit 9f6b4c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 157 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Tests
on:
workflow_dispatch:
pull_request:
- master
push:
branches:
- master
Expand Down
174 changes: 17 additions & 157 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
branches:
- master
- develop
push:
branches:
- master
Expand All @@ -21,105 +22,34 @@ env:


jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true

- uses: actions/setup-python@v2

- name: Install deps
run: python -m pip install build twine

- name: Build SDist
run: python -m build -s

- name: Check metadata
run: twine check dist/*

- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz


build_wheels:
name: ${{ matrix.type }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
build_arch_wheels:
name: ${{ matrix.arch }} wheels
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
type: [Standard]

include:
- os: ubuntu-latest
type: Standard
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_I686_IMAGE: manylinux2010

- os: ubuntu-latest
type: ManyLinux1
CIBW_MANYLINUX_X86_64_IMAGE: skhep/manylinuxgcc-x86_64
CIBW_MANYLINUX_I686_IMAGE: skhep/manylinuxgcc-i686
arch: [aarch64, s390x, ppc64le]

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

- uses: actions/setup-python@v2

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.6.4

- name: Build wheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp27-win* pp*
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.CIBW_MANYLINUX_I686_IMAGE }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.CIBW_MANYLINUX_X86_64_IMAGE }}
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: "pytest {project}/tests"

- name: Show files
run: ls -lh wheelhouse
shell: bash

- name: Verify clean directory
run: git diff --exit-code
shell: bash

- name: Upload wheels
uses: actions/upload-artifact@v2
uses: uraimo/run-on-arch-action@v2.0.5
with:
path: wheelhouse/*.whl

build_pypy_wheels:
name: PyPy wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]


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

- uses: actions/setup-python@v2

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.6.4

- name: Build wheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp*
arch: ${{ matrix.arch }}
distro: ubuntu20.04
# githubToken: ${{ github.token }}
install: |
apt-get update -q -y
apt-get install -q -y python3-pip
python3 -m pip install cibuildwheel==1.6.4
env: |
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: "pytest {project}/tests"
run: python3 -m cibuildwheel --output-dir wheelhouse

- name: Show files
run: ls -lh wheelhouse
Expand All @@ -133,73 +63,3 @@ jobs:
uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl


# Windows 2.7 (requires pybind11 workaround)
build_win27_wheels:
name: Py 2.7 wheels on Windows
runs-on: windows-latest

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

- uses: actions/setup-python@v2

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.6.4

- uses: ilammy/msvc-dev-cmd@v1

- name: Build 64-bit wheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp27-win_amd64
DISTUTILS_USE_SDK: 1
MSSdk: 1

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86

- name: Build 32-bit wheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp27-win32 pp27-win32
DISTUTILS_USE_SDK: 1
MSSdk: 1
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: "pytest {project}/tests"

- name: Show files
run: ls -lh wheelhouse
shell: bash

- name: Verify clean directory
run: git diff --exit-code
shell: bash

- uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl


upload_all:
name: Upload if release
needs: [build_wheels, build_pypy_wheels, build_win27_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/setup-python@v2

- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.pypi_password }}

0 comments on commit 9f6b4c5

Please sign in to comment.