-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate wheel building workflows in a single file (#61)
- Loading branch information
1 parent
4f81e0c
commit e488658
Showing
5 changed files
with
165 additions
and
310 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,163 @@ | ||
name: Build wheels | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # just build the sdist & wheel, skip release | ||
tags: | ||
- "*" | ||
pull_request: # also build on PRs touching files that affect wheels | ||
paths: | ||
- ".github/workflows/build_wheels.yml" | ||
- "ci/*" | ||
- "MANIFEST.in" | ||
- "pyproject.toml" | ||
- "setup.py" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_wheels_linux: | ||
name: Build wheels on Linux | ||
runs-on: "ubuntu-20.04" | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
install: true | ||
|
||
- name: Build Docker image with vcpkg and gdal | ||
# using build-push-action (without push) to make use of cache arguments | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile | ||
tags: manylinux-vcpkg-gdal:latest | ||
push: false | ||
load: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.3.1 | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_wheels_mac_win: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: "macos-10.15" | ||
triplet: "x64-osx-dynamic" | ||
- os: "windows-2019" | ||
triplet: "x64-windows" | ||
|
||
env: | ||
MACOSX_DEPLOYMENT_TARGET: "10.15" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache vcpkg | ||
uses: actions/cache@v2 | ||
id: vcpkgcache | ||
with: | ||
path: | | ||
/Users/runner/.cache/vcpkg/archives | ||
C:\vcpkg\installed | ||
key: ${{ matrix.os }}-x86_64-vcpkg-gdal3.4.2-1 | ||
|
||
# MacOS build requires aclocal, which is part of automake, but appears | ||
# to be missing in default image | ||
- name: Reinstall automake | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew reinstall automake | ||
echo $(which aclocal) | ||
- name: Install GDAL | ||
env: | ||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} | ||
run: | | ||
vcpkg install gdal[core] --overlay-triplets=./ci/custom-triplets | ||
- name: Upload vcpkg build logs | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: $VCPKG_INSTALLATION_ROOT/buildtrees/gdal/*.log | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.3.1 | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
test_wheels: | ||
name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | ||
needs: [build_wheels_linux, build_wheels_mac_win] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-20.04", "windows-latest", "macos-latest", "macos-10.15"] | ||
python-version: ["3.8", "3.9"] | ||
include: | ||
# TODO macOS is failing on py 3.10 because of shapely failure | ||
- os: "ubuntu-20.04" | ||
python-version: "3.10" | ||
- os: "windows-latest" | ||
python-version: "3.10" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache-dependency-path: "ci/requirements-wheel-test.txt" | ||
|
||
- name: Download wheels from artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: wheelhouse | ||
|
||
- name: Install dependencies and pyogrio wheel | ||
shell: bash | ||
run: | | ||
python -m pip install -r ci/requirements-wheel-test.txt | ||
python -m pip install --no-deps geopandas | ||
python -m pip install --find-links wheelhouse/artifact pyogrio | ||
python -m pip list | ||
# TODO temporary set env variable for curl certificate for Linux | ||
- name: Set CURL_CA_BUNDLE environment variable | ||
if: runner.os == 'Linux' | ||
run: | | ||
echo "CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt" >> $GITHUB_ENV | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
cd .. | ||
python -m pytest --pyargs pyogrio.tests -v |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.