Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: move to cibw on GHA #961

Merged
merged 9 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ci/azure-buildtest-awkward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ trigger:
- VERSION_INFO
- .ci/azure-doctest-awkward.yml
- .ci/azure-deploy-awkward.yml
- .ci/linux-build.sh
- .readthedocs.yml
- docs-src/*
- docs-img/*
Expand Down
259 changes: 0 additions & 259 deletions .ci/azure-deploy-awkward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,262 +61,3 @@ jobs:
inputs:
artifactName: 'wheel_$(Agent.OS)_$(Agent.JobName)_$(python.architecture)'
targetPath: 'dist'

- job: Linux

pool:
vmImage: "ubuntu-18.04"

variables:
PIP_ONLY_BINARY: cmake

strategy:
matrix:
manylinux1_i686:
DOCKER_IMAGE: quay.io/pypa/manylinux1_i686
PLAT: manylinux1_i686
manylinux1_x86_64:
DOCKER_IMAGE: quay.io/pypa/manylinux1_x86_64
PLAT: manylinux1_x86_64
manylinux2010:
DOCKER_IMAGE: quay.io/pypa/manylinux2010_x86_64
PLAT: manylinux2010_x86_64

steps:
- checkout: self
submodules: recursive

- task: DownloadSecureFile@1
name: pypirc
inputs:
secureFile: pivarski-pypirc
displayName: "Credentials"

- task: UsePythonVersion@0
inputs:
versionSpec: "3.7"
architecture: "x64"
displayName: "Python 3.7 for twine"

- script: |
python -m pip install --upgrade pip
python -m pip install twine scikit-build cmake
docker pull $(DOCKER_IMAGE)
displayName: "Install"

- script: |
if [[ $PLAT = "manylinux2010_x86_64" ]]; then
python setup.py sdist
fi
docker run -e PLAT=$(PLAT) -v `pwd`:/io $(DOCKER_IMAGE) /io/.ci/linux-build.sh
displayName: "Build"

- script: |
ls wheelhouse
mkdir -p dist
cp wheelhouse/awkward*manylinux*.whl dist/.
displayName: "Copy wheels to dist"

- script: |
python -m twine upload dist/* --config-file $(pypirc.secureFilePath) --verbose
displayName: "Deploy"
condition: "and(succeeded(), contains(variables['Build.SourceBranch'], 'tags'))"

- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel_$(Agent.OS)_$(Agent.JobName)_$(python.architecture)'
targetPath: 'dist'

- job: Windows

pool:
vmImage: "vs2017-win2016"

variables:
PIP_ONLY_BINARY: cmake

strategy:
matrix:
"py27-32bit":
python.version: "2.7"
python.architecture: "x86"
numpy.version: "1.16.5"
"py27-64bit":
python.version: "2.7"
python.architecture: "x64"
numpy.version: "1.16.5"
"py35-32bit":
python.version: "3.5"
python.architecture: "x86"
numpy.version: "latest"
"py35-64bit":
python.version: "3.5"
python.architecture: "x64"
numpy.version: "latest"
"py36-32bit":
python.version: "3.6"
python.architecture: "x86"
numpy.version: "latest"
"py36-64bit":
python.version: "3.6"
python.architecture: "x64"
numpy.version: "latest"
"py37-32bit":
python.version: "3.7"
python.architecture: "x86"
numpy.version: "latest"
"py37-64bit":
python.version: "3.7"
python.architecture: "x64"
numpy.version: "latest"
"py38-32bit":
python.version: "3.8"
python.architecture: "x86"
numpy.version: "latest"
"py38-64bit":
python.version: "3.8"
python.architecture: "x64"
numpy.version: "latest"
"py39-32bit":
python.version: "3.9"
python.architecture: "x86"
numpy.version: "latest"
"py39-64bit":
python.version: "3.9"
python.architecture: "x64"
numpy.version: "latest"

steps:
- checkout: self
submodules: recursive

- task: DownloadSecureFile@1
name: pypirc
inputs:
secureFile: pivarski-pypirc
displayName: "Credentials"

- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'
displayName: 'Python $(python.version)'

- script: |
python -m pip install --upgrade pip
python -m pip install twine wheel
displayName: "Install"

- script: |
python -m pip wheel . -v -w wheelhouse/
displayName: "Build"

- script: |
if not exist "dist" mkdir dist
cp wheelhouse/awkward*.whl dist/.
displayName: "Copy wheels to dist"

- script: |
python -m twine upload dist/* --config-file $(pypirc.secureFilePath) --verbose
displayName: "Deploy"
condition: "and(succeeded(), contains(variables['Build.SourceBranch'], 'tags'))"

- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel_$(Agent.OS)_$(Agent.JobName)_$(python.architecture)'
targetPath: 'dist'

- job: MacOS

pool:
vmImage: "macOS-10.15"

variables:
PIP_ONLY_BINARY: cmake

strategy:
matrix:
"py27":
python.version: "2.7"
python.architecture: "x64"
numpy.version: "latest"
"py37":
python.version: "3.7"
python.architecture: "x64"
numpy.version: "latest"
"py38":
python.version: "3.8"
python.architecture: "x64"
numpy.version: "latest"
"py39":
python.version: "3.9"
python.architecture: "x64"
numpy.version: "latest"

steps:
- checkout: self
submodules: recursive

- task: DownloadSecureFile@1
name: pypirc
inputs:
secureFile: pivarski-pypirc
displayName: "Credentials"

- script: |
case $(python.version) in
2.7)
FULL_VERSION=2.7.18
;;
3.7)
FULL_VERSION=3.7.9
;;
3.8)
FULL_VERSION=3.8.6
;;
3.9)
FULL_VERSION=3.9.0
;;
esac

INSTALLER_NAME=python-$FULL_VERSION-macosx10.9.pkg
URL=https://www.python.org/ftp/python/$FULL_VERSION/$INSTALLER_NAME

PY_PREFIX=/Library/Frameworks/Python.framework/Versions

set -e -x

curl $URL > $INSTALLER_NAME

sudo installer -pkg $INSTALLER_NAME -target /

sudo rm /usr/local/bin/python
sudo ln -s /usr/local/bin/python$PYTHON_VERSION /usr/local/bin/python

displayName: 'Python $(python.version)'

- script: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install setuptools twine wheel
displayName: "Install"

- script: |
python --version
python -m pip wheel . -v -w wheelhouse/
displayName: "Build"

- script: |
mkdir -p dist
cp wheelhouse/awkward*.whl dist/.
displayName: "Copy wheels to dist"

- script: |
python -m twine upload dist/* --config-file $(pypirc.secureFilePath) --verbose
displayName: "Deploy"
condition: "and(succeeded(), contains(variables['Build.SourceBranch'], 'tags'))"

- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel_$(Agent.OS)_$(Agent.JobName)_$(python.architecture)'
targetPath: 'dist'
27 changes: 0 additions & 27 deletions .ci/linux-build.sh

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
pull_request:

env:
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_SKIP: "*universal2:arm64 pp*"
CIBW_ENVIRONMENT: PIP_ONLY_BINARY=cmake,numpy
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_ARCHS_MACOS: universal2
CIBW_BUILD: cp39-win_amd64 cp36-manylinux_x86_64 cp38-macosx_universal2


jobs:
make_sdist:
name: "Make SDist"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Build SDist
run: pipx run build --sdist

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

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


build_wheels:
name: "Wheel: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]

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

- uses: pypa/cibuildwheel@v1.12.0

- name: Upload wheels
uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl
Loading