Skip to content

Overhaul allocator framework #563

Overhaul allocator framework

Overhaul allocator framework #563

Workflow file for this run

name: tests
on:
# push:
# branches: [ "main" ]
# paths-ignore:
# - "examples/**"
# - "doc/**"
# - "README.md"
# - "*.txt"
# - "CHANGELOG"
# - "tools/*.py"
pull_request:
branches: [ "main" ]
paths-ignore:
- "examples/**"
- "doc/**"
- "README.md"
- "CHANGELOG"
- "tools/*.py"
- ".github/workflows/build_wheels.yml"
- ".github/dependabot.yml"
- ".github/ISSUE_TEMPLATE/**"
- "branding/**"
- ".gitignore"
- "CMakePresets.json"
- "THANKS.txt"
- "LICENSE.txt"
- "VERSION.txt"
- "CITATION.cff"
- ".gitignore"
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Setup gha caching for vcpkg
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# - uses: microsoft/[email protected]
# if: runner.os == 'Windows'
# with:
# msbuild-architecture: x64
- name: use ninja on non windows
# if: runner.os != 'Windows'
shell: bash
run: |
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Setup msbuild on Windows
if: runner.os == 'Windows'
uses: microsoft/[email protected]
- name: Setup ninja on Windows
if: runner.os == 'Windows'
uses: ashutoshvarma/[email protected]
- name: Enable developer command prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: install pkgconfig on windows
if: runner.os == 'Windows'
shell: bash
run: |
choco install pkgconfiglite
- name: install autoconf on macos
if: runner.os == 'macOs'
shell: bash
run: |
brew install autoconf automake libtool m4 ninja
- name: Python dependencies
shell: bash
run: |
python -m pip install numpy ninja pytest pybind11
- name: setup vcpkg
shell: bash
run: |
git clone https://github.com/Microsoft/vcpkg.git tools/vcpkg
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DROUGHPY_BUILD_TESTS=ON -DROUGHPY_BUILD_PYMODULE_INPLACE=ON
env:
VERBOSE: 1
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
MACOSX_DEPLOYMENT_TARGET: 11.0.0
- name: Build
# Build your program with the given configuration
run: cmake --build ${{ github.workspace }}/build --config ${{env.BUILD_TYPE}}
env:
VERBOSE: 1
- name: Test
shell: bash
working-directory: ${{ github.workspace }}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
- name: PyTests
shell: bash
run: pytest tests
env:
PYTHONPATH: ${{ github.workspace }}