[DRAFT] Using pyproject.toml and Cmake to build wheels #8
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: Test python skbuild with CMake | |
on: [push, pull_request] | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.generate_matrix.outputs.matrix }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Generate matrix | |
id: generate_matrix | |
run: | | |
MATRIX=$(python3 ${{ github.workspace }}/.github/workflows/generate_matrix.py) | |
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT | |
build: | |
name: Build with Pip | |
runs-on: ${{ matrix.os }} | |
needs: prepare | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} | |
steps: | |
- name: Set min macOS version and install fftw and libomp | |
if: runner.os == 'macOS' | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV | |
echo "HOMEBREW_NO_AUTO_UPDATE=1" >> $GITHUB_ENV | |
if [ -f /usr/local/bin/brew ]; then | |
echo "PATH=/usr/local/bin:$PATH" >> $GITHUB_ENV | |
endif | |
if [ -f /opt/homebrew/bin/brew ]; then | |
echo "PATH=/opt/homebrew/bin:$PATH" >> $GITHUB_ENV | |
endif | |
brew install fftw libomp | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup Cpp | |
uses: aminya/setup-cpp@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
vcvarsall: ${{ contains(matrix.os, 'windows') }} | |
cmake: false | |
ninja: false | |
vcpkg: false | |
cppcheck: false | |
clangtidy: false | |
- name: Install pytest | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install pytest | |
- name: Install fftw and libomp | |
if: runner.os == 'linux' | |
run: | | |
apt-get update | |
apt install build-essential | |
apt-get install -y libfftw3-dev libomp-dev | |
- name: Set compiler flags | |
run: | | |
echo CMAKE_ARGS="-DFINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }}" >> $GITHUB_ENV | |
- name: Build | |
run: python3 -m pip install . --verbose | |
- name: Test | |
run: python3 -m pytest python/finufft/test |