Skip to content

ci: attempt to simplify test configs #535

ci: attempt to simplify test configs

ci: attempt to simplify test configs #535

Workflow file for this run

name: GitHub CI
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: On ${{ matrix.os }} with (${{ matrix.compiler }}, python-${{ matrix.python-version }}, numpy-${{ matrix.numpy-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-24.04", "macos-14"]
compiler: [gcc, clang]
python-version: ["3.9", "3.13"]
numpy-version: ["1", "2"]
exclude:
# Only run with 'clang' on OSX
- os: "macos-14"
compiler: gcc
# Don't use 'clang' on linux
- os: "ubuntu-24.04"
compiler: clang
env:
CC: ${{ matrix.compiler }}
CORRFUNC_CI: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: false
miniforge-version: latest
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -l {0}
run: |
conda create -q --yes -n test python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} nomkl
conda activate test
- name: Display PATH, compiler, python
shell: bash -l {0}
run: |
conda activate test
echo "PATH = " $PATH
echo "COMPILER = " `which ${{ matrix.compiler }}`
echo "COMPILER VERSION = " `${{ matrix.compiler }} --version`
echo "PYTHON = " `which python`
echo "(PYTHON, NUMPY) version = " `python -c "import sys; import numpy as np; print(sys.version); print(np.__version__);"`
echo "Preprocessor defs:"
echo `${{ matrix.compiler }} -dM -E - -march=native`
- name: lscpu on Linux
if: matrix.os != 'macos-14'
run: |
lscpu
- name: sysctl machdep.cpu on OSX
if: matrix.os == 'macos-14'
run: |
sysctl machdep.cpu
- name: compile
shell: bash -l {0}
run: make -r CC=${{ matrix.compiler }}
- name: install
shell: bash -l {0}
run: make install CC=${{ matrix.compiler }}
- name: compile and install python extensions
shell: bash -l {0}
run: |
echo "CC = " $CC
export CC=${{ matrix.compiler }}
python -m pip install -e .
- name: tests
shell: bash -l {0}
run: make tests CC=${{ matrix.compiler }}
- name: doctests
shell: bash -l {0}
if: matrix.os == 'ubuntu-24.04' && matrix.python-version == '3.13' && matrix.numpy-version == '2'
run: |
python -m pip install 'sphinx>=1.8'
make -C docs doctest
- name: Python tests
shell: bash -l {0}
run: |
python -m pip install pytest
python -m pytest -v