-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: restructure and split slowest job
- Loading branch information
Showing
1 changed file
with
62 additions
and
29 deletions.
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 |
---|---|---|
|
@@ -6,27 +6,58 @@ on: | |
pull_request: | ||
branches: [master] | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
CIBW_TEST_REQUIRES: pytest numpy | ||
CIBW_TEST_COMMAND: pytest {project}/tests | ||
CIBW_SKIP: pp* cp27*-win* *-win32 *-manylinux_i686 | ||
|
||
jobs: | ||
make_sdist: | ||
name: SDist | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Make sdist | ||
run: | | ||
pipx run build --sdist | ||
- name: Upload artifacts to GitHub | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./dist | ||
|
||
|
||
make_wheels: | ||
name: ${{ matrix.os }} ${{ matrix.arch }} | ||
name: ${{ matrix.os }} ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
arch: "x86_64" # Need better support in scikit-build for universal2 | ||
build: "cp*-macosx_x86_64" | ||
name: macOS Intel | ||
- os: windows-latest | ||
arch: auto | ||
build: "cp3*-win_amd64" | ||
name: Windows 64-bit | ||
- os: ubuntu-latest | ||
build: "cp*-manylinux_x86_64" | ||
name: Linux Intel 64-bit | ||
- os: ubuntu-latest | ||
build: "cp36-manylinux_aarch64" | ||
name: Linux Aarch64 3.6 | ||
- os: ubuntu-latest | ||
arch: auto | ||
build: "cp37-manylinux_aarch64" | ||
name: Linux Aarch64 3.7 | ||
- os: ubuntu-latest | ||
arch: aarch64 | ||
build: "cp38-manylinux_aarch64" | ||
name: Linux Aarch64 3.8 | ||
- os: ubuntu-latest | ||
build: "cp39-manylinux_aarch64" | ||
name: Linux Aarch64 3.9 | ||
|
||
steps: | ||
|
||
|
@@ -47,40 +78,42 @@ jobs: | |
echo "CXX=cl.exe" >> $GITHUB_ENV | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' && matrix.arch != 'auto' | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: ${{ matrix.arch }} | ||
platforms: aarch64 | ||
|
||
## Build | ||
|
||
- uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
|
||
- name: Make sdist | ||
if: runner.os == 'Linux' | ||
run: | | ||
pipx run build --sdist --outdir=wheelhouse | ||
## Upload | ||
CIBW_TEST_REQUIRES: pytest numpy | ||
CIBW_TEST_COMMAND: pytest {project}/tests | ||
CIBW_ARCH_LINUX: auto aarch64 | ||
|
||
- name: Check with Twine | ||
run: | | ||
pipx run twine check wheelhouse/* | ||
- name: Upload artifacts to GitHub | ||
if: github.event_name == 'release' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse | ||
path: wheelhouse/*.whl | ||
|
||
upload_all: | ||
needs: [make_sdist, make_wheels] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.pypi_password }} | ||
|
||
|
||
- name: Release to PyPI | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.pypi_password }} | ||
run: | | ||
pipx run twine upload wheelhouse/* |