Skip to content

Commit 7b544a7

Browse files
author
Jeff Whitaker
authored
Merge pull request #18 from MacPython/test_arm64
testing cross-compilation again
2 parents 06a200e + db0c183 commit 7b544a7

File tree

2 files changed

+117
-18
lines changed

2 files changed

+117
-18
lines changed

.github/workflows/build-wheels.yml renamed to .github/workflows/build-wheels-linux.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ jobs:
2121
run:
2222
shell: bash
2323
strategy:
24-
2524
fail-fast: false
25+
2626
matrix:
2727
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]
28-
os: [ubuntu-latest, macos-latest]
28+
os: [ubuntu-latest]
2929
platform: [x64, x32]
30-
exclude:
31-
- os: macos-latest
32-
platform: x32
3330
include:
3431
- python-version: "3.6"
3532
os: ubuntu-latest
@@ -46,15 +43,7 @@ jobs:
4643
- python-version: "3.10"
4744
os: ubuntu-latest
4845
platform: aarch64
49-
- python-version: "3.8"
50-
os: macos-latest
51-
platform: x86_64
52-
- python-version: "3.9"
53-
os: macos-latest
54-
platform: x86_64
55-
- python-version: "3.10"
56-
os: macos-latest
57-
platform: x86_64
46+
5847
env:
5948
REPO_DIR: netcdf4-python
6049
PKG_NAME: netcdf4-python
@@ -86,16 +75,13 @@ jobs:
8675
run: |
8776
if [ "schedule" == "${{ github.event_name }}" ] || [ "master" == "$BUILD_COMMIT" ]; then echo "TOKEN=$SCIPY_WHEELS_NIGHTLY_ACCESS" >> $GITHUB_ENV; else echo "TOKEN=$MULTIBUILD_WHEELS_STAGING_ACCESS" >> $GITHUB_ENV; fi
8877
if [ "x32" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; elif [ "aarch64" == "${{ matrix.platform }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; else echo "PLAT=x86_64" >> $GITHUB_ENV; fi
89-
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
9078
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
9179
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
92-
# make universal2 wheels on macos by cross-compiling
93-
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "PLAT=universal2" >> $GITHUB_ENV; fi
9480
9581
- name: Setup Special Environment variables for Linux AArch64
9682
if: ${{ matrix.platform == 'aarch64' }}
9783
run: |
98-
echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_arm64v8)" >> $GITHUB_ENV
84+
echo "DOCKER_TEST_IMAGE=$(echo multibuild/focal_arm64v8)" >> $GITHUB_ENV
9985
10086
- name: Pin Numpy version
10187
run: |
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# This workflow will install Python dependencies, run tests and build
2+
# manylinux wheels for a variety of python versions and architectures.
3+
4+
name: Build and upload macosx wheels
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
create:
12+
tags:
13+
# schedule:
14+
# - cron: '0 0 * * 0,3' # 2/weekly
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ${{ matrix.os }}
20+
defaults:
21+
run:
22+
shell: bash
23+
strategy:
24+
fail-fast: false
25+
26+
matrix:
27+
python-version: [ "3.8", "3.9","3.10" ]
28+
os: [macos-latest]
29+
platform: [x86_64]
30+
env:
31+
REPO_DIR: netcdf4-python
32+
PKG_NAME: netcdf4-python
33+
MB_ML_VER: 2014
34+
BUILD_COMMIT: v1.5.8rel
35+
UNICODE_WIDTH: 32
36+
MB_PYTHON_VERSION: ${{ matrix.python-version }}
37+
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
38+
TRAVIS_REPO_SLUG: ${{ github.repository }}
39+
TRAVIS_BRANCH: ${{ github.head_ref }}
40+
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
41+
TRAVIS_BUILD_DIR: ${{ github.workspace }}
42+
MULTIBUILD_WHEELS_STAGING_ACCESS: ${{ secrets.MULTIBUILD_WHEELS_STAGING_ACCESS }}
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
with:
47+
submodules: recursive
48+
- name: Set up Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v2
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Setup Environment variables
54+
run: |
55+
if [ "schedule" == "${{ github.event_name }}" ] || [ "master" == "$BUILD_COMMIT" ]; then echo "TOKEN=$SCIPY_WHEELS_NIGHTLY_ACCESS" >> $GITHUB_ENV; else echo "TOKEN=$MULTIBUILD_WHEELS_STAGING_ACCESS" >> $GITHUB_ENV; fi
56+
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
57+
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
58+
echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV
59+
echo "PLAT=universal2" >> $GITHUB_ENV
60+
61+
- name: Pin Numpy version
62+
run: |
63+
if [ "$MB_PYTHON_VERSION" == '3.6' ]; then
64+
echo "NP_DEP=$(echo numpy==1.17.3)" >> $GITHUB_ENV;
65+
elif [ "$MB_PYTHON_VERSION" == '3.7' ]; then
66+
echo "NP_DEP=$(echo numpy==1.17.3)" >> $GITHUB_ENV;
67+
elif [ "$MB_PYTHON_VERSION" == '3.8' ]; then
68+
echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV;
69+
elif [ "$MB_PYTHON_VERSION" == '3.9' ]; then
70+
echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV;
71+
elif [ "$MB_PYTHON_VERSION" == '3.10' ]; then
72+
echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV;
73+
else
74+
echo "None of the defined python version, use default"
75+
fi
76+
77+
- name: Print some Environment variable
78+
run: |
79+
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
80+
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
81+
echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}"
82+
echo "TRAVIS_EVENT_TYPE: ${TRAVIS_EVENT_TYPE}"
83+
echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
84+
echo "PLAT: ${PLAT}"
85+
echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}"
86+
87+
- name: Install VirtualEnv
88+
run: |
89+
python -m pip install --upgrade pip
90+
pip install virtualenv
91+
- name: Build and Install Wheels
92+
run: |
93+
BUILD_DEPENDS="$NP_DEP cython setuptools"
94+
TEST_DEPENDS="$NP_DEP nose cython"
95+
source multibuild/common_utils.sh
96+
source multibuild/travis_steps.sh
97+
echo "------- BEFORE INSTALL --------"
98+
before_install
99+
echo "------- CLEAN CODE --------"
100+
clean_code $REPO_DIR $BUILD_COMMIT
101+
echo "------- BUILD WHEEL --------"
102+
build_wheel $REPO_DIR $PLAT
103+
echo "------- INSTALL_RUN --------"
104+
install_run $PLAT
105+
- name: Upload wheels to release
106+
uses: svenstaro/upload-release-action@v2
107+
if: github.event_name == 'create'
108+
with:
109+
repo_token: ${{ secrets.GITHUB_TOKEN }}
110+
file: ${{ github.workspace }}/wheelhouse/netCDF4*whl
111+
tag: ${{ github.ref }}
112+
overwrite: true
113+
file_glob: true

0 commit comments

Comments
 (0)