ci: attempt to simplify test configs #543
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: 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: | |
include: | |
- os: ubuntu-24.04 | |
compiler: gcc | |
python-version: 3.9 | |
numpy-version: 1 | |
- os: ubuntu-24.04 | |
compiler: gcc | |
python-version: 3.13 | |
numpy-version: 2 | |
- os: macos-14 | |
compiler: clang | |
python-version: 3.9 | |
numpy-version: 1 | |
- os: macos-14 | |
compiler: clang | |
python-version: 3.13 | |
numpy-version: 2 | |
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 | |
miniforge-version: latest | |
conda-remove-defaults: true | |
auto-activate-base: false | |
activate-environment: "" | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
conda create -n test python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} nomkl gsl | |
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 |