Skip to content

check

check #4

Workflow file for this run

name: CI
on:
push:
branches:
- 'action*'
tags:
- '*'
pull_request:
branches:
- '*'
env:
COBAYA_INSTALL_SKIP: polychord,planck_2015,CamSpec2021,2018_highl_CamSpec,unbinned,keck,classy
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: "Anaconda: jammy LTS Python (fast; pip CAMB)"
os: ubuntu-latest
pydist: "ANACONDA"
- name: "Latest Python 3.12"
os: ubuntu-latest
python-version: 3.12
- name: "OS X Python 3.8"
os: macos-latest
python-version: 3.8
- name: "Windows Python 3.12"
os: windows-latest
python-version: 3.12
steps:
- run: gfortran --version
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
if: matrix.pydist != 'ANACONDA'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Miniconda
if: matrix.pydist == 'ANACONDA'
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
- name: Install mpi
if: matrix.pydist != 'ANACONDA'
uses: mpi4py/setup-mpi@v1
with:
mpi: openmpi
# - name: Cache dependencies
# uses: actions/cache@v2
# with:
# path: |
# ${{ github.workspace }}/packages/data/planck_supp_data_and_covmats
# ${{ github.workspace }}/packages/data/bao_data
# ${{ github.workspace }}/packages/data/sn_data
# ${{ github.workspace }}/packages/data/des_data
# ${{ github.workspace }}/packages/data/planck_2018_pliklite_native
# key: ${{ runner.os }}-build-${{ matrix.python-version }}}
- name: Install dependencies (pip)
if: matrix.pydist != 'ANACONDA'
run: |
pip install mpi4py -i https://pypi.anaconda.org/mpi4py/simple
pip install -r requirements.txt pytest-xdist pytest-cov flaky matplotlib dill coverage flake8 iminuit numba camb
- name: Install dependencies (Anaconda)
if: matrix.pydist == 'ANACONDA'
run: |
conda install -y scipy matplotlib cython PyYAML dill coverage pytest pandas mpi4py openmpi
conda install -y -c conda-forge iminuit
pip install -r requirements.txt flake8 flaky pytest-xdist pytest-cov camb
- name: Run flake8
run: |
flake8 cobaya --select=E713,E704,E703,E714,E741,E10,E11,E20,E22,E23,E25,E27,E301,E302,E304,E9,F405,F406,F5,F6,F7,F8,W1,W2,W3,W6 --show-source --statistics
- name: Run cobaya install and tests
run: |
export COBAYA_PACKAGES_PATH="../packages"
coverage run --parallel-mode -m cobaya.install polychord --debug
coverage run --parallel-mode -m pytest tests/ -n auto -k "not cosmo" --skip-not-installed --no-flaky-report
coverage run --parallel-mode -m cobaya.install cosmo-tests --no-progress-bars --debug --skip-global
pytest tests/ --cov -vv -s -k "cosmo" -n 2 --skip-not-installed --no-flaky-report
- name: Run MPI tests
run: |
mpiexec -np 2 --oversubscribe coverage run --parallel-mode -m pytest -x -m mpi tests/ --no-flaky-report
- name: Run external likelihood tests
run: |
git clone --depth=1 https://github.com/CobayaSampler/example_external_likelihood
pip install ./example_external_likelihood --quiet
coverage run --parallel-mode -m unittest test_package.tests.test
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1