Skip to content

Commit

Permalink
.github/workflows/build_package.yaml: update windows build and fix ma…
Browse files Browse the repository at this point in the history
…cos build
  • Loading branch information
szobov committed Oct 20, 2024
1 parent ef9bed7 commit 2120df1
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions .github/workflows/build_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest] # , windows-latest
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false

steps:
Expand Down Expand Up @@ -43,9 +43,6 @@ jobs:
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ matrix.python-version }}-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo clippy
run: cargo clippy --all -- -D warnings

- name: Install maturin on Linux (with patchelf)
if: matrix.os == 'ubuntu-latest'
run: pip install maturin[patchelf]
Expand All @@ -64,14 +61,31 @@ jobs:
if: matrix.os == 'macos-latest'
run: brew install openblas gfortran

# - name: Set up OpenBLAS on Windows
# if: matrix.os == 'windows-latest'
# run: |
# curl -L -o openblas.zip https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
# tar -xf openblas.zip -C C:/openblas
# setx /M OPENBLAS_DIR "C:\openblas"
# setx /M PATH "%PATH%;%OPENBLAS_DIR%\bin"
# shell: cmd
- name: Set up vcpkg and install OpenBLAS
if: matrix.os == 'windows-latest'
run: |
git clone https://github.com/Microsoft/vcpkg.git --depth 1
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg.exe install openblas:x64-windows
shell: cmd

- name: Set VCPKG_ROOT environment variable on Windows
if: matrix.os == 'windows-latest'
run: |
setx VCPKG_ROOT "%cd%\vcpkg"
setx PATH "%PATH%;%cd%\vcpkg\installed\x64-windows\bin"
shell: cmd

- name: Run cargo clippy
run: cargo clippy --all -- -D warnings
env:
OPENBLAS_DIR: ${{ matrix.os == 'windows-latest' && '%VCPKG_ROOT%/installed/x64-windows' || '/usr/local/opt/openblas' }}

- name: Run cargo tests
run: cargo test
env:
OPENBLAS_DIR: ${{ matrix.os == 'windows-latest' && '%VCPKG_ROOT%/installed/x64-windows' || '/usr/local/opt/openblas' }}

- name: Build wheels with maturin on macOS
if: matrix.os == 'macos-latest'
Expand All @@ -87,17 +101,12 @@ jobs:
env:
OPENBLAS_DIR: /usr/lib/x86_64-linux-gnu

# - name: Build wheels with maturin on Windows
# if: matrix.os == 'windows-latest'
# run: |
# maturin build --release --out dist
# env:
# OPENBLAS_DIR: C:\openblas

- name: Run cargo tests
run: cargo test
- name: Build wheels with maturin on Windows
if: matrix.os == 'windows-latest'
run: |
maturin build --release --out dist
env:
OPENBLAS_DIR: ${{ matrix.os == 'windows-latest' && 'C:/openblas' || '/usr/local/opt/openblas' }}
OPENBLAS_DIR: %VCPKG_ROOT%/installed/x64-windows

- name: Install the built package
run: |
Expand Down

0 comments on commit 2120df1

Please sign in to comment.