Skip to content

DOC add comment on binsize definition #332

DOC add comment on binsize definition

DOC add comment on binsize definition #332

Workflow file for this run

name: TreeCorr CI
on:
push:
branches:
- main
- releases/*
pull_request:
branches:
- main
- releases/*
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
strategy:
matrix:
# First all python versions in basic linux
os: [ ubuntu-latest ]
py: [ 3.7, 3.8, 3.9, "3.10", "pypy-3.9" ]
CC: [ gcc ]
CXX: [ g++ ]
# Add some other particular combinations to test
include:
# One in MacOS
- os: macos-latest
py: 3.9
CC: cc
CXX: c++
# Check one with clang compiler
- os: ubuntu-latest
py: 3.8
CC: clang
CXX: clang++
# Check one with gcc-11
- os: ubuntu-latest
py: 3.9
CC: gcc-11
CXX: g++-11
# Check one on Windows
- os: windows-latest
py: 3.9
CC: gcc
CXX: g++
steps:
- uses: actions/checkout@v2
with:
# Helpful for a reliable codecov upload.
fetch-depth: 0
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.py }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.py }}-pip-
${{ runner.os }}-
- name: Install libffi, etc. on linux
if: matrix.os == 'ubuntu-latest'
run: |
echo ${{ matrix.os }}
sudo -H apt-get -qq update
sudo -H apt-get install -y libffi-dev openmpi-bin libopenmpi-dev
- name: Install gcc-11
if: matrix.CC == 'gcc-11'
run: |
echo ${{ matrix.CC }}
sudo -H apt-get -qq update
sudo -H apt-get install -y gcc-11 g++-11
- name: Install libffi, etc. on MacOS
if: matrix.os == 'macos-latest'
# brew sometimes exits with 1 if things are already installed.
# continue-on-error means that this still counds as success for this step.
continue-on-error: true
run: |
echo ${{ matrix.os }}
brew update
brew install libffi openmpi
- name: Install basic dependencies
run: |
python -m pip install -U pip
# Do this first to clarify potential conflicts
pip install -U numpy
# Standard dependencies
pip install -U -r requirements.txt
# Extra packages needed for testing
pip install -U nose mpi4py coverage mockmpi pytest
# Note: I'd rather include h5py here, but I can't get it to install properly
# on GHA for pypy3. So only do that for regular py3.
- name: Install py3.x dependencies
# They are slow to install on pypy, where some are installed from scratch.
if: matrix.py > 3.0
run: |
pip install -U matplotlib nbval ipykernel scipy pandas guppy3 h5py pyarrow
- name: Install fitsio everywhere but Windows
if: matrix.os != 'windows-latest'
run: |
pip install -U fitsio
- name: List all installed packages for reference
run: pip list
- name: Build TreeCorr
run: pip install -vvv .
- name: Run unit tests
run: |
cd tests
coverage run -m pytest -v
cd .. # N.B. This seems to happen automatically if omitted.
# Less confusing to include it explicitly.
- name: Upload coverage to codecov
if: matrix.os != 'windows-latest'
#uses: codecov/codecov-action@v1 # This didn't work for me.
# TODO: Supposedly there is a v2 now that might work better.
run: |
cd tests
pwd -P
ls -la
coverage combine || true # (Not necessary I think, but just in case.)
coverage report
ls -la
# cf. https://community.codecov.io/t/github-not-getting-codecov-report-after-switching-from-travis-to-github-actions-for-ci/
# The solution was to switch to the bash uploader line instead.
bash <(curl -s https://codecov.io/bash)
cd ..
- name: Test MPI
# The code is already mostly checked in the main tests with mock_mpi.
# These just check that the code works when run in a real mpi session.
if: matrix.os != 'windows-latest'
run: |
cd tests
which -a mpiexec
which -a mpirun
mpiexec -n 2 --oversubscribe python -u mpi_test.py #>& mpi2.out
mpiexec -n 1 python -u mpi_test.py #>& mpi1.out
cd ..
- name: Test Tutorial notebook
if: matrix.py == 3.7
run: |
cd tests
pytest --nbval Tutorial.ipynb --sanitize-with sanitize.cfg --current-env
cd ..