-
Notifications
You must be signed in to change notification settings - Fork 13
153 lines (145 loc) · 4.88 KB
/
posix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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 tools/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 [[ "$NIGHTLY" = "true" ]]; then
# Set the pyproject.toml version
version = $(cd OpenBLAS && git describe --tags --abbrev=8 | sed -e "s/^v\(.*\)-g.*/\1/")
sed -e "s/^version = .*/version = ${version}/" -i.bak pyproject.toml
fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
source tools/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}" \
-e MB_ML_LIBC="${MB_ML_LIBC}" \
-v $(pwd):/openblas $docker_image \
/bin/bash -xe /openblas/tools/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
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: upload
- name: Upload
# see https://github.com/marketplace/actions/setup-miniconda for why
# `-el {0}` is required.
shell: bash -el {0}
env:
ANACONDA_SCIENTIFIC_PYTHON_UPLOAD: ${{ secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD }}
run: |
# Pin urllib3<2 due to github.com/Anaconda-Platform/anaconda-client/issues/654
conda install -y anaconda-client 'urllib3<2.0.0'
source tools/upload_to_anaconda_staging.sh
upload_wheels