forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (86 loc) · 2.9 KB
/
windows.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
name: Windows Meson tests
on:
push:
branches:
- main
- maintenance/**
pull_request:
branches:
- main
- maintenance/**
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
name: Meson Windows tests
# Ensure (a) this doesn't run on forks by default, and
# (b) it does run with Act locally (`github` doesn't exist there)
if: "github.repository == 'scipy/scipy' || github.repository == ''"
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'environment.yml'
- name: install-rtools
run: |
choco install rtools --no-progress
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
- name: show-gfortran
run: |
gcc --version
gfortran --version
- name: pip-packages
run: |
pip install numpy==1.22.2 cython pybind11 pythran meson ninja pytest pytest-xdist pytest-timeout pooch
- name: openblas-libs
run: |
# Download and install pre-built OpenBLAS library
# Built with mingw-w64, -ucrt -static.
# https://github.com/matthew-brett/openblas-libs/blob/ucrt-build/build_openblas.ps1
choco install unzip -y
choco install wget -y
wget https://github.com/scipy/scipy-ci-artifacts/raw/main/openblas_32_if.zip
unzip -d c:\ openblas_32_if.zip
echo "PKG_CONFIG_PATH=c:\opt\openblas\if_32\64\lib\pkgconfig;" >> $env:GITHUB_ENV
- name: meson-configure
run: |
meson setup build --prefix=$PWD\build
- name: meson-build
run: |
ninja -j 2 -C build
- name: meson-install
run: |
cd build
meson install
- name: build-path
run: |
echo "installed_path=$PWD\build\Lib\site-packages" >> $env:GITHUB_ENV
- name: post-install
run: |
$scipy_path = "${env:installed_path}\scipy"
$libs_path = "${scipy_path}\.libs"
mkdir ${libs_path}
$ob_path = (pkg-config --variable libdir openblas) -replace "lib", "bin"
cp $ob_path/*.dll $libs_path
# Write _distributor_init.py to scipy dir to load .libs DLLs.
& python tools\openblas_support.py --write-init $scipy_path
- name: prep-test
run: |
echo "PYTHONPATH=${env:installed_path}" >> $env:GITHUB_ENV
echo "SCIPY_USE_PROPACK=1" >> $env:GITHUB_ENV
- name: test
run: |
mkdir tmp
cd tmp
python -c 'import scipy; scipy.test()'