Skip to content

Merge pull request #262 from LibRapid/dependabot/github_actions/KyleM… #1471

Merge pull request #262 from LibRapid/dependabot/github_actions/KyleM…

Merge pull request #262 from LibRapid/dependabot/github_actions/KyleM… #1471

Workflow file for this run

# Workflow to build
name: Wheels
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
workflow_dispatch:
workflow_call:
jobs:
# Build the wheels for Linux, Windows and macOS for CPython 3.7 and newer
build_wheels:
name: Build wheel for ${{ matrix.pythonType }}${{ matrix.pythonVersion }}-${{ matrix.platformID }}
runs-on: ${{ matrix.os }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
include:
# Window 64 bit
- os: windows-latest
pythonVersion: 37
bitness: 64
platformID: win_amd64
pythonType: "cp"
- os: windows-latest
pythonVersion: 38
bitness: 64
platformID: win_amd64
pythonType: "cp"
- os: windows-latest
pythonVersion: 39
bitness: 64
platformID: win_amd64
pythonType: "cp"
- os: windows-latest
pythonVersion: 310
bitness: 64
platformID: win_amd64
pythonType: "cp"
- os: windows-latest
pythonVersion: 311
bitness: 64
platformID: win_amd64
pythonType: "cp"
- os: windows-latest
pythonVersion: 312
bitness: 64
platformID: win_amd64
pythonType: "cp"
# Arm Windows
# - os: windows-latest
# pythonVersion: 39
# bitness: 32
# platformID: win_arm64
# pythonType: "cp"
# - os: windows-latest
# pythonVersion: 310
# bitness: 32
# platformID: win_arm64
# pythonType: "cp"
# - os: windows-latest
# pythonVersion: 311
# bitness: 32
# platformID: win_arm64
# pythonType: "cp"
# - os: windows-latest
# pythonVersion: 312
# bitness: 32
# platformID: win_arm64
# pythonType: "cp"
# PyPy on Windows
# - os: windows-latest
# pythonVersion: 37
# bitness: 64
# platformID: win_amd64
# pythonType: "pp"
# - os: windows-latest
# pythonVersion: 38
# bitness: 64
# platformID: win_amd64
# pythonType: "pp"
# - os: windows-latest
# pythonVersion: 39
# bitness: 64
# platformID: win_amd64
# pythonType: "pp"
- os: windows-latest
pythonVersion: 310
bitness: 64
platformID: win_amd64
pythonType: "pp"
# Linux 64 bit manylinux2014
- os: ubuntu-latest
pythonVersion: 37
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "cp"
- os: ubuntu-latest
pythonVersion: 38
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "cp"
- os: ubuntu-latest
pythonVersion: 39
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "cp"
- os: ubuntu-latest
pythonVersion: 310
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "cp"
- os: ubuntu-latest
pythonVersion: 311
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "cp"
- os: ubuntu-latest
pythonVersion: 312
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "cp"
# Linux PyPy 64 bit manylinux2014
- os: ubuntu-latest
pythonVersion: 37
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "pp"
- os: ubuntu-latest
pythonVersion: 38
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "pp"
- os: ubuntu-latest
pythonVersion: 39
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "pp"
- os: ubuntu-latest
pythonVersion: 310
bitness: 64
platformID: manylinux_x86_64
manylinux_image: manylinux2014
pythonType: "pp"
# MacOS x86_64
- os: macos-latest
pythonVersion: 37
bitness: 64
platformID: macosx_x86_64
pythonType: "cp"
- os: macos-latest
pythonVersion: 38
bitness: 64
platformID: macosx_x86_64
pythonType: "cp"
- os: macos-latest
pythonVersion: 39
bitness: 64
platformID: macosx_x86_64
pythonType: "cp"
- os: macos-latest
pythonVersion: 310
bitness: 64
platformID: macosx_x86_64
pythonType: "cp"
- os: macos-latest
pythonVersion: 311
bitness: 64
platformID: macosx_x86_64
pythonType: "cp"
- os: macos-latest
pythonVersion: 312
bitness: 64
platformID: macosx_x86_64
pythonType: "cp"
# Apple-Silicon MacOS
- os: macos-latest
pythonVersion: 38
bitness: 64
platformID: macosx_arm64
pythonType: "cp"
- os: macos-latest
pythonVersion: 39
bitness: 64
platformID: macosx_arm64
pythonType: "cp"
- os: macos-latest
pythonVersion: 310
bitness: 64
platformID: macosx_arm64
pythonType: "cp"
- os: macos-latest
pythonVersion: 311
bitness: 64
platformID: macosx_arm64
pythonType: "cp"
- os: macos-latest
pythonVersion: 312
bitness: 64
platformID: macosx_arm64
pythonType: "cp"
# Apple-Silicon MacOS PyPy
# - os: macos-latest
# pythonVersion: 38
# bitness: 64
# platformID: macosx_arm64
# pythonType: "pp"
# - os: macos-latest
# pythonVersion: 39
# bitness: 64
# platformID: macosx_arm64
# pythonType: "pp"
# - os: macos-latest
# pythonVersion: 310
# bitness: 64
# platformID: macosx_arm64
# pythonType: "pp"
steps:
- name: Checkout LibRapid
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Requirements
run: pip install -r requirements.txt
- name: Install XCode
if: matrix.os == 'macos-latest'
uses: maxim-lobanov/setup-xcode@v1.5.1
with:
xcode-version: latest
# This doesn't work for some reason
# - name: Install Clang
# if: matrix.os == 'macos-latest'
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: "15.0"
# directory: "./llvm"
# env: on
- name: Install Clang
if: matrix.os == 'macos-latest'
run: |
rm -f '/usr/local/bin/2to3*'
brew install llvm libomp
- name: Build Wheels
if: runner.os == 'macOS'
env:
CIBW_BUILD: ${{ matrix.pythonType }}${{ matrix.pythonVersion }}-${{ matrix.platformID }}
CIBW_ARCHS: all
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_PYPY_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_BUILD_VERBOSITY: 1
MACOSX_DEPLOYMENT_TARGET: 10.15
CMAKE_BUILD_PARALLEL_LEVEL: 1
GITHUB_ACTIONS: ON
LIBRAPID_GET_BLAS: OFF
LIBRAPID_GET_FFTW: OFF
CC: /usr/local/opt/llvm/bin/clang
CXX: /usr/local/opt/llvm/bin/clang++
# CC: $(brew --prefix llvm)/bin/clang
# CXX: $(brew --prefix llvm)/bin/clang++
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
- name: Build Wheels
if: runner.os != 'macOS'
env:
CIBW_BUILD: ${{ matrix.pythonType }}${{ matrix.pythonVersion }}-${{ matrix.platformID }}
CIBW_ARCHS: all
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_PYPY_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_BUILD_VERBOSITY: 1
CMAKE_BUILD_PARALLEL_LEVEL: 1
GITHUB_ACTIONS: ON
LIBRAPID_GET_BLAS: ON
LIBRAPID_GET_FFTW: OFF
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
- name: Store Artifacts
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
# Build the source distribution under Linux
build_sdist:
name: Source Distribution
runs-on: ubuntu-latest
steps:
- name: Checkout LibRapid
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # update once build dependencies are available
- name: Install Requirements
run: pip install -r requirements.txt
- name: Build Source Distribution
run: |
python -m build --sdist --outdir dist
twine check dist/*.tar.gz
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
# Upload the wheels and the source distribution
upload_artifacts:
name: Upload to PyPi
runs-on: ubuntu-latest
# needs: [build_wheels, build_wheels_cuda, build_sdist]
needs: [ build_wheels, build_sdist ]
# The artifacts cannot be uploaded on PRs
if: github.event_name != 'pull_request'
steps:
- name: Checkout LibRapid
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: dist
- name: Setup Python
uses: actions/setup-python@v5
- name: Install Requirements
run: pip install -r requirements.txt
- name: Upload Artifacts
continue-on-error: true
run: |
ls dist
twine upload --skip-existing dist/artifact/* -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
# To uncomment: remove hash -- no space after!!!
# # Build the wheels for Linux and Windows with CUDA support
# build_wheels_cuda:
# name: Build wheel for ${{ matrix.cppp }}${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}-cuda${{ matrix.cuda_version }}
# runs-on: ${{ matrix.os }}
# needs: [run_linux_tests, run_macos_tests, run_windows_tests]
# if: needs.check_build_trigger.outputs.build
#
# strategy:
# # Ensure that a wheel builder finishes even if another fails
# fail-fast: false
# matrix:
# include:
# # Window 64 bit
# - os: windows-latest
# python: 37
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.4.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 37
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.5.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 37
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.6.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 37
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.7.0"
# use_openblas: true
# cppp: "cp"
#
# - os: windows-latest
# python: 38
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.4.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 38
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.5.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 38
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.6.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 38
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.7.0"
# use_openblas: true
# cppp: "cp"
#
# - os: windows-latest
# python: 39
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.4.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 39
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.5.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 39
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.6.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 39
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.7.0"
# use_openblas: true
# cppp: "cp"
#
# - os: windows-latest
# python: 310
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.4.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 310
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.5.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 310
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.6.0"
# use_openblas: true
# cppp: "cp"
# - os: windows-latest
# python: 310
# bitness: 64
# platform_id: win_amd64
# cuda_version: "11.7.0"
# use_openblas: true
# cppp: "cp"
#
# steps:
# - name: Checkout LibRapid
# uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.9" # update once build dependencies are available
#
# - name: Install Requirements
# run: pip install -r requirements.txt
#
# - name: Clone OpenBLAS Build
# if: ${{ matrix.use_openblas }}
# uses: dawidd6/action-download-artifact@v2
# with:
# workflow: build-openblas.yaml
# workflow_conclusion: success
# name: OpenBLAS on ${{ matrix.os }}
# path: src/librapid/openblas_install
#
# - name: Install CUDA-Toolkit
# uses: Jimver/cuda-toolkit@v0.2.8
# with:
# cuda: ${{ matrix.cuda_version }}
#
# - name: Build Wheels
# env:
# CIBW_BUILD: ${{ matrix.cppp }}${{ matrix.python }}-${{ matrix.platform_id }}
# CIBW_ARCHS: all
# CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
# CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
# CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux_image }}
# CIBW_MANYLINUX_PYPY_I686_IMAGE: ${{ matrix.manylinux_image }}
# CIBW_TEST_SKIP: "*-macosx_arm64"
# CIBW_BUILD_VERBOSITY: 1
# CMAKE_BUILD_PARALLEL_LEVEL: 1
# LIBRAPID_CUDA_WHEEL: ${{ matrix.cuda_version }}
# LIBRAPID_CI_BUILD: true
#
# run: |
# python -m pip install cibuildwheel
# python -m cibuildwheel --output-dir wheelhouse
#
# - name: Store Artifacts
# uses: actions/upload-artifact@v4
# with:
# path: wheelhouse/*.whl