Skip to content

Commit b9da638

Browse files
committed
Revert "Remove unnecessary github builds."
This reverts commit 792be79.
1 parent 497f917 commit b9da638

File tree

2 files changed

+358
-0
lines changed

2 files changed

+358
-0
lines changed

.github/workflows/posix.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: posix
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch: null
9+
schedule:
10+
- cron: '0 0 * * 0'
11+
12+
env:
13+
REPO_DIR: OpenBLAS
14+
OPENBLAS_COMMIT: "v0.3.29"
15+
MACOSX_DEPLOYMENT_TARGET: 10.9
16+
17+
jobs:
18+
build:
19+
runs-on: ${{ matrix.os }}
20+
defaults:
21+
run:
22+
shell: bash
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-latest, macos-13]
27+
PLAT: [i686, x86_64]
28+
INTERFACE64: ['0', '1']
29+
MB_ML_VER: ['2014']
30+
MB_ML_LIBC: ['manylinux']
31+
include:
32+
- os: macos-13
33+
PLAT: arm64
34+
INTERFACE64: '1'
35+
- os: macos-13
36+
PLAT: arm64
37+
INTERFACE64: '0'
38+
- os: ubuntu-latest
39+
PLAT: x86_64
40+
INTERFACE64: '1'
41+
MB_ML_LIBC: musllinux
42+
MB_ML_VER: _1_2
43+
- os: ubuntu-latest
44+
PLAT: x86_64
45+
INTERFACE64: '0'
46+
MB_ML_LIBC: musllinux
47+
MB_ML_VER: _1_2
48+
49+
- os: ubuntu-24.04-arm
50+
PLAT: aarch64
51+
INTERFACE64: '0'
52+
MB_ML_VER: '2014'
53+
- os: ubuntu-24.04-arm
54+
PLAT: aarch64
55+
INTERFACE64: '1'
56+
MB_ML_VER: '2014'
57+
- os: ubuntu-24.04-arm
58+
PLAT: aarch64
59+
INTERFACE64: '0'
60+
MB_ML_LIBC: musllinux
61+
MB_ML_VER: _1_2
62+
- os: ubuntu-24.04-arm
63+
PLAT: aarch64
64+
INTERFACE64: '1'
65+
MB_ML_LIBC: musllinux
66+
MB_ML_VER: _1_2
67+
68+
exclude:
69+
- PLAT: i686
70+
os: macos-13
71+
- PLAT: i686
72+
INTERFACE64: '1'
73+
env:
74+
NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
75+
MB_PYTHON_VERSION: ${{ matrix.python-version }}
76+
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
77+
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
78+
MB_ML_VER: ${{ matrix.MB_ML_VER }}
79+
INTERFACE64: ${{ matrix.INTERFACE64 }}
80+
BUILD_DIR: ${{ github.workspace }}
81+
PLAT: ${{ matrix.PLAT }}
82+
83+
steps:
84+
- uses: actions/[email protected]
85+
with:
86+
submodules: recursive
87+
fetch-depth: 0
88+
- name: Set up Python
89+
uses: actions/setup-python@v5
90+
with:
91+
python-version: 3.9
92+
- name: Set extra env
93+
run: |
94+
echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_${{ matrix.PLAT}})" >> $GITHUB_ENV;
95+
96+
- uses: maxim-lobanov/[email protected]
97+
if: ${{ matrix.os == 'macos-13' }}
98+
with:
99+
xcode-version: '14.3'
100+
101+
- name: Print some Environment variable
102+
run: |
103+
echo "PLAT: ${PLAT}"
104+
echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}"
105+
- name: Install VirtualEnv
106+
run: |
107+
python3 -m pip install --upgrade pip
108+
pip install virtualenv
109+
- name: Build OpenBLAS
110+
run: |
111+
set -xeo pipefail
112+
source tools/build_steps.sh
113+
echo "------ BEFORE BUILD ---------"
114+
before_build
115+
if [[ "$NIGHTLY" = "true" ]]; then
116+
echo "------ CLEAN CODE --------"
117+
clean_code $REPO_DIR develop
118+
echo "------ BUILD LIB --------"
119+
build_lib "$PLAT" "$INTERFACE64" "1"
120+
else
121+
echo "------ CLEAN CODE --------"
122+
clean_code $REPO_DIR $OPENBLAS_COMMIT
123+
echo "------ BUILD LIB --------"
124+
build_lib "$PLAT" "$INTERFACE64" "0"
125+
fi
126+
127+
# - name: Setup tmate session
128+
# if: ${{ failure() }}
129+
# uses: mxschmitt/action-tmate@v3
130+
# with:
131+
# limit-access-to-actor: true
132+
133+
- name: Build and test wheel
134+
run: |
135+
if [[ "$NIGHTLY" = "true" ]]; then
136+
# Set the pyproject.toml version: convert v0.3.24-30-g138ed79f to 0.3.34.30
137+
version=$(cd OpenBLAS && git describe --tags --abbrev=8 | sed -e "s/^v\(.*\)-g.*/\1/" | sed -e "s/-/./g")
138+
sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml
139+
fi
140+
if [ "macos-13" == "${{ matrix.os }}" ]; then
141+
source tools/build_wheel.sh
142+
else
143+
libc=${MB_ML_LIBC:-manylinux}
144+
docker_image=quay.io/pypa/${libc}${MB_ML_VER}_${PLAT}
145+
docker run --rm -e INTERFACE64="${INTERFACE64}" \
146+
-e MB_ML_LIBC="${MB_ML_LIBC}" \
147+
-v $(pwd):/openblas $docker_image \
148+
/bin/bash -xe /openblas/tools/build_wheel.sh
149+
sudo chmod -R a+w dist
150+
fi
151+
152+
- uses: actions/[email protected]
153+
with:
154+
name: wheels-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }}
155+
path: dist/scipy_openblas*.whl
156+
157+
- uses: actions/[email protected]
158+
with:
159+
name: openblas-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }}
160+
path: libs/openblas*.tar.gz
161+
162+
- uses: conda-incubator/[email protected]
163+
with:
164+
channels: conda-forge
165+
channel-priority: true
166+
activate-environment: upload
167+
miniforge-version: latest
168+
169+
- name: Upload
170+
# see https://github.com/marketplace/actions/setup-miniconda for why
171+
# `-el {0}` is required.
172+
shell: bash -el {0}
173+
env:
174+
ANACONDA_SCIENTIFIC_PYTHON_UPLOAD: ${{ secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD }}
175+
run: |
176+
conda install -y anaconda-client
177+
source tools/upload_to_anaconda_staging.sh
178+
upload_wheels

.github/workflows/windows.yml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
name: Win
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch: null
9+
10+
env:
11+
OPENBLAS_COMMIT: "v0.3.29"
12+
OPENBLAS_ROOT: "c:\\opt"
13+
# Preserve working directory for calls into bash
14+
# Without this, invoking bash will cd to the home directory
15+
CHERE_INVOKING: "yes"
16+
BASH_PATH: "c:\\rtools40\\usr\\bin\\bash.exe"
17+
18+
jobs:
19+
build:
20+
strategy:
21+
matrix:
22+
plat: ['x64', 'x86']
23+
INTERFACE64: ['1', '0']
24+
os: [windows-latest]
25+
exclude:
26+
- plat: x86
27+
INTERFACE64: '1'
28+
fail-fast: false
29+
runs-on: ${{ matrix.os }}
30+
31+
timeout-minutes: 90
32+
steps:
33+
- uses: actions/[email protected]
34+
- name: install-rtools
35+
run: |
36+
# rtools 42+ does not support 32 bits builds.
37+
choco install -y rtools --no-progress --force --version=4.0.0.20220206
38+
39+
- name: Set env variables
40+
run: |
41+
echo "START_DIR=$PWD" >> $env:GITHUB_ENV
42+
# For interpretation of MSYSTEM, see:
43+
# https://sourceforge.net/p/msys2/discussion/general/thread/b7dfdac8/#3939
44+
if ( "${{ matrix.plat }}" -eq "x86") {
45+
echo "PLAT=i686" >> $env:GITHUB_ENV
46+
echo "WHEEL_PLAT=win32" >> $env:GITHUB_ENV
47+
echo "MSYSTEM=MINGW32" >> $env:GITHUB_ENV
48+
# No ucrt on 32-bits, so use _snprintf_c instead
49+
echo "LDFLAGS=-static -static-libgcc -Wl,--defsym,_quadmath_snprintf=__snprintf_c" >> $env:GITHUB_ENV
50+
echo "BUILD_BITS=32" >> $env:GITHUB_ENV
51+
} else {
52+
echo "PLAT=x86_64" >> $env:GITHUB_ENV
53+
echo "WHEEL_PLAT=win_amd64" >> $env:GITHUB_ENV
54+
echo "MSYSTEM=UCRT64" >> $env:GITHUB_ENV
55+
echo "LDFLAGS=-lucrt -static -static-libgcc -Wl,--defsym,quadmath_snprintf=snprintf" >> $env:GITHUB_ENV
56+
echo "BUILD_BITS=64" >> $env:GITHUB_ENV
57+
}
58+
if ( ${{ matrix.INTERFACE64 }} -eq "1" ) {
59+
echo "INTERFACE64=1" >> $env:GITHUB_ENV
60+
}
61+
$CIBW = "${{ github.workspace }}/.openblas"
62+
$CIBW = $CIBW.replace("\","/")
63+
echo "CIBW_ENVIRONMENT_WINDOWS=PKG_CONFIG_PATH=$CIBW" >> $env:GITHUB_ENV
64+
65+
- name: Debug
66+
run: |
67+
echo CIBW_ENVIRONMENT_WINDOWS=$env:CIBW_ENVIRONMENT_WINDOWS
68+
69+
- name: Build
70+
run: |
71+
git submodule update --init --recursive
72+
& $env:BASH_PATH -lc tools/build_openblas.sh
73+
74+
- name: Test
75+
run: |
76+
& $env:BASH_PATH -lc tools/build_gfortran.sh
77+
echo "Static test"
78+
.\for_test\test.exe
79+
echo "Dynamic test"
80+
.\for_test\test_dyn.exe
81+
82+
- name: Copy
83+
run: |
84+
cp for_test\test*.exe builds
85+
86+
- name: Set up Python
87+
uses: actions/setup-python@v5
88+
with:
89+
python-version: 3.9
90+
architecture: ${{ matrix.plat }}
91+
92+
93+
- name: Build wheel
94+
shell: bash
95+
run: |
96+
set -xeo pipefail
97+
python -m pip install wheel
98+
# This will fail if there is more than one file in libs
99+
unzip -d local/scipy_openblas64 builds/openblas*.zip
100+
if [[ -d local/scipy_openblas64/64 ]]; then
101+
mv local/scipy_openblas64/64/* local/scipy_openblas64
102+
else
103+
mv local/scipy_openblas64/32/* local/scipy_openblas64
104+
fi
105+
mv local/scipy_openblas64/bin/*.dll local/scipy_openblas64/lib
106+
rm local/scipy_openblas64/lib/*.a
107+
rm -f local/scipy_openblas64/lib/*.exp # may not exist?
108+
rm local/scipy_openblas64/lib/*.def
109+
rm -rf local/scipy_openblas64/lib/pkgconfig
110+
if [[ -d local/scipy_openblas64/64 ]]; then
111+
rm -rf local/scipy_openblas64/64
112+
else
113+
rm -rf local/scipy_openblas64/32
114+
fi
115+
if [[ "${INTERFACE64}" != "1" ]]; then
116+
mv local/scipy_openblas64 local/scipy_openblas32
117+
# rewrite the name of the project to scipy-openblas32
118+
# this is a hack, but apparently there is no other way to change the name
119+
# of a pyproject.toml project
120+
sed -e "s/openblas64/openblas32/" -i pyproject.toml
121+
sed -e "s/openblas_get_config64_/openblas_get_config/" -i local/scipy_openblas32/__init__.py
122+
sed -e "s/cflags =.*/cflags = '-DBLAS_SYMBOL_PREFIX=scipy_'/" -i local/scipy_openblas32/__init__.py
123+
sed -e "s/openblas64/openblas32/" -i local/scipy_openblas32/__init__.py
124+
sed -e "s/openblas64/openblas32/" -i local/scipy_openblas32/__main__.py
125+
fi
126+
echo "" >> LICENSE.txt
127+
echo "----" >> LICENSE.txt
128+
echo "" >> LICENSE.txt
129+
cat tools/LICENSE_win32.txt >> LICENSE.txt
130+
python -m pip wheel -w dist -vv .
131+
# move the mis-named scipy_openblas64-none-any.whl to a platform-specific name
132+
for f in dist/*.whl; do mv $f "${f/%any.whl/$WHEEL_PLAT.whl}"; done
133+
134+
- name: Set up different Python
135+
uses: actions/setup-python@v5
136+
with:
137+
python-version: 3.11
138+
architecture: ${{ matrix.plat }}
139+
140+
- uses: actions/[email protected]
141+
with:
142+
name: wheels-${{matrix.plat }}-${{ matrix.INTERFACE64 }}
143+
path: dist/scipy_openblas*.whl
144+
145+
- uses: actions/[email protected]
146+
with:
147+
name: openblas-${{matrix.plat }}-${{ matrix.INTERFACE64 }}
148+
path: builds/openblas*.zip
149+
150+
- name: Test 64-bit interface wheel
151+
if: matrix.INTERFACE64 == '1'
152+
run: |
153+
python -m pip install --no-index --find-links dist scipy_openblas64
154+
python -m scipy_openblas64
155+
python -c "import scipy_openblas64; print(scipy_openblas64.get_pkg_config())"
156+
157+
- name: Test 32-bit interface wheel
158+
if: matrix.INTERFACE64 != '1'
159+
run: |
160+
python -m pip install --no-index --find-links dist scipy_openblas32
161+
python -m scipy_openblas32
162+
python -c "import scipy_openblas32; print(scipy_openblas32.get_pkg_config())"
163+
164+
- uses: conda-incubator/[email protected]
165+
with:
166+
channels: conda-forge
167+
channel-priority: true
168+
activate-environment: upload
169+
miniforge-version: latest
170+
171+
- name: Upload
172+
# see https://github.com/marketplace/actions/setup-miniconda for why
173+
# `-el {0}` is required.
174+
shell: bash -el {0}
175+
env:
176+
ANACONDA_SCIENTIFIC_PYTHON_UPLOAD: ${{ secrets.ANACONDA_SCIENTIFIC_PYTHON_UPLOAD }}
177+
run: |
178+
conda install -y anaconda-client
179+
source tools/upload_to_anaconda_staging.sh
180+
upload_wheels

0 commit comments

Comments
 (0)