Have the rest of the samplers save their best-fit as a hint #434
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Continuous Integration | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
# run this every week at 12 noon on Monday | |
- cron: '0 12 * * 1' | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10", 3.11] | |
# macos13 runs on until and macos14 now runs on arm64 | |
os: [ubuntu-20.04, macos-latest, macos-13] | |
exclude: | |
# Python 3.7 is not available on M1 Mac homebrew | |
- os: macos-latest | |
python-version: 3.7 | |
include: | |
- os: ubuntu-20.04 | |
INSTALL_DEPS: sudo apt-get update && sudo apt-get -y install gfortran-7 swig libopenmpi-dev openmpi-bin libopenblas-dev && sudo ln -s `which gfortran-7` /usr/local/bin/gfortran | |
- os: macos-latest | |
# Different versions of homebrew put the gfortran in different | |
INSTALL_DEPS: > | |
brew update-reset | |
&& HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gcc swig libomp open-mpi openblas | |
&& COSMOSIS_GCC_VER=$(brew list --versions gcc | awk '{print $2}' | cut -d. -f1) | |
&& GFORTRAN_PATH1=/usr/local/bin/gfortran | |
&& GFORTRAN_PATH2=/usr/local/bin/gfortran-${COSMOSIS_GCC_VER} | |
&& GFORTRAN_PATH3=/opt/homebrew/bin/gfortran | |
&& GFORTRAN_PATH4=/opt/homebrew/bin/gfortran-${COSMOSIS_GCC_VER} | |
&& if ! which -s gfortran | |
; then if [ -f $GFORTRAN_PATH2 ]; then ln -s $GFORTRAN_PATH2 $GFORTRAN_PATH1; echo Linking gfortran from /usr/local | |
; elif [ -f $GFORTRAN_PATH4 ]; then ln -s $GFORTRAN_PATH4 $GFORTRAN_PATH3; echo Linking gfortran from /opt/homebrew | |
; else echo "gfortran not found" && exit 1 | |
; fi | |
; fi | |
&& echo "gfortran now at $(which -a gfortran)" | |
- os: macos-13 | |
# Different versions of homebrew put the gfortran in different | |
INSTALL_DEPS: > | |
brew update-reset | |
&& HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gcc swig libomp open-mpi openblas | |
&& COSMOSIS_GCC_VER=$(brew list --versions gcc | awk '{print $2}' | cut -d. -f1) | |
&& GFORTRAN_PATH1=/usr/local/bin/gfortran | |
&& GFORTRAN_PATH2=/usr/local/bin/gfortran-${COSMOSIS_GCC_VER} | |
&& GFORTRAN_PATH3=/opt/homebrew/bin/gfortran | |
&& GFORTRAN_PATH4=/opt/homebrew/bin/gfortran-${COSMOSIS_GCC_VER} | |
&& if ! which -s gfortran | |
; then if [ -f $GFORTRAN_PATH2 ]; then ln -s $GFORTRAN_PATH2 $GFORTRAN_PATH1; echo Linking gfortran from /usr/local | |
; elif [ -f $GFORTRAN_PATH4 ]; then ln -s $GFORTRAN_PATH4 $GFORTRAN_PATH3; echo Linking gfortran from /opt/homebrew | |
; else echo "gfortran not found" && exit 1 | |
; fi | |
; fi | |
&& echo "gfortran now at $(which -a gfortran)" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # caching pip dependencies | |
cache-dependency-path: 'setup.py' | |
- name: Install dependencies | |
run: ${{ matrix.INSTALL_DEPS }} | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -v . | |
pip install --no-binary=mpi4py mpi4py astropy pytest pytest-cov | |
- name: Install PocoMC | |
if: matrix.python-version != '3.7' | |
run: | | |
pip install pocomc==1.2.2 | |
- name: Test nautilus alone | |
if: (matrix.python-version == '3.11' || matrix.python-version =='3.10') && (matrix.os == 'macos-13') | |
run: | | |
# On some systems it seems like nautilus runs out of | |
# memory when run with the full test suite. | |
python cosmosis/test/test_samplers.py test_nautilus | |
- name: Test with pytest | |
run: | | |
cosmosis --version | |
if [[ "${{ matrix.os }}" == 'macos-13' && ("${{ matrix.python-version }}" == '3.10' || "${{ matrix.python-version }}" == '3.11') ]]; then | |
export SKIP_NAUTILUS=1 | |
fi | |
mkdir tmp && cd tmp && pytest --pyargs cosmosis --cov cosmosis --cov-report=xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-20.04' | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |