Create an openblas wheel #40
Workflow file for this run
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
name: posix | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: null | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-11] | |
PLAT: [i686, x86_64] | |
INTERFACE64: ['0', '1'] | |
MB_ML_VER: ['2014'] | |
include: | |
- os: macos-11 | |
PLAT: arm64 | |
INTERFACE64: '1' | |
- os: macos-11 | |
PLAT: arm64 | |
INTERFACE64: '0' | |
- os: ubuntu-latest | |
PLAT: x86_64 | |
INTERFACE64: '1' | |
MB_ML_LIBC: musllinux | |
MB_ML_VER: _1_1 | |
- os: ubuntu-latest | |
PLAT: x86_64 | |
INTERFACE64: '0' | |
MB_ML_LIBC: musllinux | |
MB_ML_VER: _1_1 | |
exclude: | |
- PLAT: i686 | |
os: macos-11 | |
- PLAT: i686 | |
INTERFACE64: '1' | |
env: | |
REPO_DIR: OpenBLAS | |
OPENBLAS_COMMIT: "c2f4bdb" | |
NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
MACOSX_DEPLOYMENT_TARGET: 10.9 | |
MB_PYTHON_VERSION: ${{ matrix.python-version }} | |
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} | |
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }} | |
MB_ML_VER: ${{ matrix.MB_ML_VER }} | |
INTERFACE64: ${{ matrix.INTERFACE64 }} | |
BUILD_DIR: ${{ github.workspace }} | |
PLAT: ${{ matrix.PLAT }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Set extra env | |
run: | | |
if [ "macos-11" == "${{ matrix.os }}" ]; then | |
echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; | |
echo "LDFLAGS=-L/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib" >> $GITHUB_ENV; | |
echo "LIBRARY_PATH=-L/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib" >> $GITHUB_ENV; | |
else | |
echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; | |
fi | |
echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_${{ matrix.PLAT}})" >> $GITHUB_ENV; | |
- name: Print some Environment variable | |
run: | | |
echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}" | |
echo "PLAT: ${PLAT}" | |
echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}" | |
- name: Install VirtualEnv | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install virtualenv | |
- name: Build OpenBLAS | |
run: | | |
set -xeo pipefail | |
if [[ "$PLAT" == "arm64" ]]; then | |
sudo xcode-select -switch /Applications/Xcode_12.5.1.app | |
export SDKROOT=/Applications/Xcode_12.5.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk | |
clang --version | |
fi | |
source travis-ci/build_steps.sh | |
echo "------ BEFORE BUILD ---------" | |
before_build | |
if [[ "$NIGHTLY" = "true" ]]; then | |
echo "------ CLEAN CODE --------" | |
clean_code $REPO_DIR develop | |
echo "------ BUILD LIB --------" | |
build_lib "$PLAT" "$INTERFACE64" "1" | |
else | |
echo "------ CLEAN CODE --------" | |
clean_code $REPO_DIR $OPENBLAS_COMMIT | |
echo "------ BUILD LIB --------" | |
build_lib "$PLAT" "$INTERFACE64" "0" | |
fi | |
- name: Build and test wheel | |
run: | | |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then | |
source travis-ci/build_wheel.sh | |
else | |
libc=${MB_ML_LIBC:-manylinux} | |
docker_image=quay.io/pypa/${libc}${MB_ML_VER}_${PLAT} | |
docker run --rm -e INTERFACE64="${INTERFACE64}" -v $(pwd):/openblas $docker_image /bin/bash -xe /openblas/travis-ci/build_wheel.sh | |
fi | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: openblas | |
path: libs/openblas*.tar.gz | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist/scipy_openblas*.whl | |
- name: Upload | |
run: | | |
set -ex | |
TOKEN=${{ secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD }} | |
if [ "$TOKEN" == "" ]; then | |
# The token is available when under the MacPython org, not on forks | |
echo "secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD is not defined: skipping"; | |
else | |
# Pin urllib3<2 due to github.com/Anaconda-Platform/anaconda-client/issues/654 | |
pip install "urllib3<2.0.0" | |
pip install git+https://github.com/Anaconda-Server/anaconda-client@1.8.0 | |
# The first -t option refers to the token, the second is the "type" | |
# option to the "upload" command | |
args=( | |
-t ${TOKEN} upload | |
--no-progress -u scientific-python-nightly-wheels | |
-t file -p "openblas-libs" | |
-d "OpenBLAS for multibuild wheels" | |
-s "OpenBLAS for multibuild wheels" | |
) | |
if [[ "$NIGHTLY" = "true" ]]; then | |
args+=(--force) | |
args+=(-v "HEAD") | |
else | |
args+=(--skip) | |
args+=(-v "$(cd OpenBLAS && git describe --tags --abbrev=8)") | |
fi | |
anaconda "${args[@]}" libs/openblas*.tar.gz | |
fi |