Skip to content

Fixes for CI

Fixes for CI #159

Workflow file for this run

name: Build Windows package
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build_windows:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CC: clang-cl
CXX: clang-cl
LDFLAGS: "-Wl,-S"
strategy:
fail-fast: false
matrix:
os: ["windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
# - name: Install rtools (mingw-w64)
# run: |
# choco install rtools -y --no-progress --force --version=4.0.0.20220206
# echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
## NOTE: this installs clang, but no OpenMP yet
# - name: Set up Clang
# uses: egor-tensin/setup-clang@v1
# with:
# version: latest
# platform: x64
## NOTE: MSVC seems to only support OpenMP up to 2.0
# - name: Setup MSVC
# uses: ilammy/msvc-dev-cmd@v1
# - name: Setup MSVC
# uses: bus1/cabuild/action/msdevshell@v1
# with:
# architecture: x64
## NOTE: this installs clang, clang-cl, lld, etc
- name: Install Clang with OpenMP support using Chocolatey
run: |
choco install -y llvm --params "clang;compiler=clang" --version 17.0.0
$env:PATH = "C:\Program Files\LLVM\bin;$env:PATH"
clang --version
# - name: Install OpenBLAS using Chocolatey
# run: |
# choco install -y openblas
# $env:PATH = "C:\ProgramData\chocolatey\lib\openblas\tools\bin;$env:PATH"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip build ninja delvewheel
python -m pip install pytest pytest-cov pytest-benchmark bokeh
- name: Install package
run: |
python -m pip install . --verbose
- name: Test with pytest
run: |
python -m pytest tests/ --cov=primate --benchmark-skip
coverage report -m
- name: Uninstall the package
run: |
python -m pip uninstall primate -y
- name: Build a wheel
run: |
python -m build
echo "WHEEL_NAME=$(ls dist/*.whl | head -1)" >> $GITHUB_ENV
shell: bash
- name: Echo wheel
run: |
echo $env:wheel_name
- name: Install the wheel
run: |
python -m pip install --verbose ${{ env.WHEEL_NAME }} --force-reinstall
# - name: Repair the wheel
# run: |
# delvewheel repair $GITHUB_WORKSPACE/dist/*.whl
- name: Wheel load dry-run
run: |
python -c "import primate; print(primate.__version__)"
- name: Test the wheel
run: |
python -m pytest tests/ --cov=primate --benchmark-skip
coverage report -m
# - name: Make wheel w/ delvewheel
# python -m pip install $(find "$output_dir" -type f | grep *primate*.whl)
# python -m pip install $env:wheel_name
# run: |
# bash ./tools/repair_windows.sh
# output_dir="$(mktemp -d)"
# python -m pip wheel . --no-deps --wheel-dir "$output_dir"
# $GITHUB_WORKSPACE/wheelhouse .
# delvewheel repair -w dist -v wheelhouse/*.whl
# python -m build --wheel
# $env:wheel_name=Get-ChildItem -Path dist/* -Include *.whl
# delvewheel repair -w dist $env:wheel_name