From 09ae83ae4df7cdf0439a5aea42db28773ae25cb7 Mon Sep 17 00:00:00 2001 From: Toby Davis Date: Thu, 9 Nov 2023 16:44:27 +0000 Subject: [PATCH] test something --- .github/workflows/testWheels.yaml | 162 ++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 .github/workflows/testWheels.yaml diff --git a/.github/workflows/testWheels.yaml b/.github/workflows/testWheels.yaml new file mode 100644 index 00000000..5c0ff662 --- /dev/null +++ b/.github/workflows/testWheels.yaml @@ -0,0 +1,162 @@ +# Workflow to build +name: Test Wheels + +on: + push: + branches: + - "**" + pull_request: + branches: + - "**" + workflow_dispatch: + workflow_call: + +jobs: + build_wheels: + name: Build wheel for ${{ matrix.platform }}${{ 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: 312 + bitness: 64 + platformID: win_amd64 + pythonType: "cp" + platform: "windows" + + - os: windows-latest + pythonVersion: 310 + bitness: 64 + platformID: win_amd64 + pythonType: "pp" + platform: "windows" + + # Linux 64 bit manylinux2014 + - os: ubuntu-latest + pythonVersion: 312 + bitness: 64 + platformID: manylinux_x86_64 + manylinux_image: manylinux2014 + pythonType: "cp" + platform: "linux" + + # Linux PyPy 64 bit manylinux2014 + - os: ubuntu-latest + pythonVersion: 312 + bitness: 64 + platformID: manylinux_x86_64 + manylinux_image: manylinux2014 + pythonType: "pp" + platform: "linux" + + # MacOS x86_64 + - os: macos-latest + pythonVersion: 312 + bitness: 64 + platformID: macosx_x86_64 + pythonType: "cp" + platform: "macos" + + # Apple-Silicon MacOS + - os: macos-latest + pythonVersion: 310 + bitness: 64 + platformID: macosx_arm64 + pythonType: "cp" + platform: "macos" + + steps: + - name: Workflow Telemetry + uses: runforesight/workflow-telemetry-action@v1.8.7 + with: + theme: "dark" + + - name: Checkout LibRapid + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Install Requirements + run: pip install -r requirements.txt + + - name: Install XCode + if: runner.os == 'macOS' + uses: maxim-lobanov/setup-xcode@v1.5.1 + with: + xcode-version: latest + + - name: Install Clang + if: runner.os == 'macOS' + run: | + rm -f '/usr/local/bin/2to3*' + brew install llvm libomp + + - name: Install Clang + if: runner.os == 'Windows' + uses: KyleMayes/install-llvm-action@v1 + with: + version: '16.0' + directory: ${RUNNER_TOOL_CACHE} + env: on + + - name: Build Wheels + run: | + python -m pip install cibuildwheel + python -m cibuildwheel --output-dir wheelhouse --platform ${{ matrix.platform }} --arch ${{ matrix.bitness }} + 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 + + - name: Store Artifacts + uses: actions/upload-artifact@v3 + 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@v4 + 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@v3 + with: + path: dist/*.tar.gz