Skip to content

Commit b81dc86

Browse files
authored
Merge pull request #41 from mattip/github-actions
Use GitHub actions on windows instead of appveyor
2 parents bc589fe + 9c22b95 commit b81dc86

File tree

6 files changed

+69
-17
lines changed

6 files changed

+69
-17
lines changed

.github/workflows/build.yml

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,83 @@
22

33
name: CI
44

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
5+
defaults:
6+
run:
7+
shell: bash
8+
79
on:
810
push:
911
branches: [ master ]
1012
pull_request:
1113
branches: [ master ]
1214

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
env:
16+
OPENBLAS_COMMIT: 349b722d8d09303
17+
OPENBLAS_ROOT: "c:\\opt"
18+
1419
jobs:
15-
# This workflow contains a single job called "build"
1620
build:
1721
strategy:
1822
matrix:
1923
BUILD_BITS: [64, 32]
2024
INTERFACE64: ['1', '']
2125
os: [windows-latest]
22-
# The type of runner that the job will run on
26+
exclude:
27+
- BUILD_BITS: 32
28+
INTERFACE64: 1
29+
2330
runs-on: ${{ matrix.os }}
2431

25-
# Steps represent a sequence of tasks that will be executed as part of the job
2632
steps:
27-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2833
- uses: actions/checkout@v2
34+
- uses: ilammy/msvc-dev-cmd@v1
35+
36+
- name: Setup
37+
run: |
38+
BITS=${{ matrix.BUILD_BITS }}
39+
echo "BUILD_BITS=$BITS" >> $GITHUB_ENV;
40+
if [ "$BITS" == "32" ]; then
41+
echo "PLAT=i686" >> $GITHUB_ENV;
42+
43+
else
44+
echo "PLAT=x86_64" >> $GITHUB_ENV;
45+
fi
46+
echo "START_DIR=$PWD" >> $GITHUB_ENV;
47+
choco install -y zip
2948
30-
# Runs a set of commands using the runners shell
31-
- name: Run a multi-line script
49+
- run: |
50+
choco install -y mingw --forcex86 --force --version=7.3.0
51+
name: Install 32-bit mingw
52+
shell: powershell
53+
if: ${{ matrix.BUILD_BITS == '32' }}
54+
55+
- name: Build
56+
run: |
57+
BITS=${{ matrix.BUILD_BITS }}
58+
if [ "$BITS" == "32" ]; then
59+
export PATH=/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw32/bin:$PATH
60+
fi
61+
echo $PATH
62+
git submodule update --init --recursive
63+
tools/build_openblas.sh
64+
65+
- name: Test
66+
run: |
67+
BITS=${{ matrix.BUILD_BITS }}
68+
if [ "$BITS" == "32" ]; then
69+
export PATH=/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw32/bin:$PATH
70+
fi
71+
tools/build_gfortran.sh
72+
cp test.exe builds
73+
cp test_dyn.exe builds
74+
./test.exe
75+
cp $(cygpath $OPENBLAS_ROOT)/$BITS/bin/*.dll .
76+
./test_dyn.exe
77+
78+
- name: Upload
79+
env:
80+
OPENBLAS_LIBS_STAGING_UPLOAD_TOKEN: ${{ secrets.MULTIBUILD_WHEELS_STAGING_ACCESS }}
3281
run: |
33-
echo Add other actions to build,
34-
echo test, and deploy your project.
82+
pip install -q git+https://github.com/Anaconda-Platform/[email protected]
83+
tools/upload_to_anaconda_staging.sh
84+

appveyor.yml renamed to _appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ build_script:
4848
- git submodule update --init --recursive
4949
- set MSYSTEM=MINGW%BUILD_BITS%
5050
- set START_DIR=%__CD__%
51-
- set SCRIPT_DIR=%START_DIR%appveyor\
51+
- set SCRIPT_DIR=%START_DIR%tools\
5252
# Need --login to process MSYSTEM variable
5353
- bash --login %SCRIPT_DIR%build_openblas.sh
5454

File renamed without changes.

appveyor/build_openblas.sh renamed to tools/build_openblas.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
# OPENBLAS_ROOT
55
# OPENBLAS_COMMIT
66
# BUILD_BITS
7-
# VC9_ROOT
7+
# START_DIR
8+
# Expects "lib.exe" and "gcc" to be on the path
89

9-
set -e
10+
set -ex
1011

1112
# Paths in Unix format
1213
OPENBLAS_ROOT=$(cygpath "$OPENBLAS_ROOT")
13-
VC9_ROOT=$(cygpath "$VC9_ROOT")
1414

1515
# Our directory for later copying
1616
our_wd=$(cygpath "$START_DIR")
@@ -20,6 +20,7 @@ rm -rf builds
2020
mkdir builds
2121

2222
cd OpenBLAS
23+
git submodule update --init --recursive
2324

2425
# Check which gcc we're using
2526
which gcc
@@ -42,11 +43,12 @@ if [ "$BUILD_BITS" == 64 ]; then
4243
else
4344
march=pentium4
4445
extra="-mfpmath=sse -msse2"
46+
fextra="-m32"
4547
vc_arch="i386"
4648
plat_tag="win32"
4749
fi
4850
cflags="-O2 -march=$march -mtune=generic $extra"
49-
fflags="$cflags -frecursive -ffpe-summary=invalid,zero"
51+
fflags="$fextra $cflags -frecursive -ffpe-summary=invalid,zero"
5052

5153
# Set suffixed-ILP64 flags
5254
if [ "$INTERFACE64" == "1" ]; then
@@ -91,7 +93,7 @@ cd $BUILD_BITS/lib
9193
# export library. Maybe fixed in later binutils by patch referred to in
9294
# https://sourceware.org/ml/binutils/2016-02/msg00002.html
9395
cp ${our_wd}/OpenBLAS/exports/${DLL_BASENAME}.def ${DLL_BASENAME}.def
94-
"$VC9_ROOT/bin/lib.exe" /machine:${vc_arch} /def:${DLL_BASENAME}.def
96+
"lib.exe" /machine:${vc_arch} /def:${DLL_BASENAME}.def
9597
cd ../..
9698
# Build template site.cfg for using this build
9799
cat > ${BUILD_BITS}/site.cfg.template << EOF
File renamed without changes.

0 commit comments

Comments
 (0)