Skip to content

Add A_mod non-linear Pk #1921

Add A_mod non-linear Pk

Add A_mod non-linear Pk #1921

Workflow file for this run

name: Testing
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
COBAYA_PACKAGES_PATH: ./cobaya_packages
jobs:
check-skip:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check.outputs.skip }}
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Run skip-check
id: check
uses: ./.github/actions/check-skip
test:
needs: check-skip
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
python-version: '3.13'
tags: []
- os: ubuntu-latest
python-version: '3.12'
tags: []
- os: ubuntu-latest
python-version: '3.11'
tags: cov
- os: ubuntu-latest
python-version: '3.10'
tags: []
- os: macos-latest
python-version: '3.11'
tags: []
if: ${{ needs.check-skip.outputs.skip != 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install GSL
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt-get update
sudo apt-get install -y libgsl-dev
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
brew update
brew install gsl
fi
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: false
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Cache virtual environment
uses: actions/cache@v4
id: cache-venv
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('uv.lock') }}
- name: Cache cobaya_packages
id: cache-cobaya
uses: actions/cache@v4
with:
path: ./cobaya_packages
key: cobaya_packages-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('uv.lock') }}
- name: Install SOLikeT dependencies and likelihoods
run: |
bash ci_scripts/install_deps.sh --extras dev all
- name: Run tests (coverage)
if: contains(matrix.tags, 'cov')
env:
COBAYA_PACKAGES_PATH: ./cobaya_packages
run: |
uv run pytest --cov --cov-branch --cov-report=xml -vv --durations=10
- name: Run tests (no coverage)
if: ${{ !contains(matrix.tags, 'cov') }}
env:
COBAYA_PACKAGES_PATH: ./cobaya_packages
run: |
uv run pytest -vv --durations=10
- if: contains(matrix.tags, 'cov')
name: Report Coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
aggregate:
needs: [test]
runs-on: ubuntu-latest
if: ${{ always() }}
name: 🛠 Aggregate test results
steps:
- name: Show individual results
run: |
echo "matrix test result: ${{ needs.test.result }}"
- name: Fail if any failed
run: |
if [ "${{ needs.test.result }}" = "failure" ]; then
echo "❌ matrix test failed"
exit 1
fi
echo "👍 All succeeded or skipped"