workflow draft #36
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test Python wheels | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.buildplat[0] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
buildplat: | |
- [ ubuntu-22.04, manylinux_x86_64 ] | |
- [ ubuntu-22.04, musllinux_x86_64 ] | |
- [ windows-2019, win_amd64 ] | |
python: [ "cp310", "cp311", "cp312", "cp313" ] # exclude pp313t for now | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
c:\msys64\usr\bin\pacman.exe -Sy --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-pkgconf | |
echo "c:\msys64\mingw64\bin;" >> $env:GITHUB_PATH | |
- name: Setup Path ${{ matrix.buildplat[0] }} | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
echo "/usr/local/cuda-11.4/bin" >> GITHUB_PATH | |
echo "LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:\$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
- name: Setup Path Windows | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
Add-Content -Path $env:GITHUB_PATH -Value "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin" | |
Add-Content -Path $env:GITHUB_ENV -Value "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4" | |
- name: Build wheels ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
uses: pypa/[email protected] | |
with: | |
package-dir: 'python/cufinufft' | |
env: | |
CIBW_BEFORE_ALL_LINUX: | | |
if command -v yum &> /dev/null; then | |
yum install -y epel-release | |
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo | |
yum install -y cuda-11-4 | |
elif command -v apt &> /dev/null; then | |
apt update | |
apt install -y software-properties-common | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb | |
dpkg -i cuda-keyring_1.0-1_all.deb | |
apt update | |
apt install -y cuda-11-4 | |
else | |
echo "Unsupported package manager. Exiting." | |
exit 1 | |
fi | |
CIBW_BEFORE_ALL_WINDOWS: > | |
$cuda_installer = "https://developer.download.nvidia.com/compute/cuda/11.4.0/network_installers/cuda_11.4.0_win10_network.exe" | |
$cuda_installer_path = "$env:TEMP\cuda_installer.exe" | |
Invoke-WebRequest -Uri $cuda_installer -OutFile $cuda_installer_path | |
Start-Process -FilePath $cuda_installer_path -ArgumentList "-s" -NoNewWindow -Wait | |
CIBW_ARCHS_LINUX: x86_64 | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
CIBW_TEST_COMMAND: "echo 'Wheel installed'" | |
CIBW_BUILD_FRONTEND: "pip; args: --no-deps" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
path: ./wheelhouse/*.whl |