dist: jammy
language: python

matrix:
    include:
        - python: '3.8'
          env:

        - python: '3.9'
          env:
            - COVERAGE="true"

        - python: '3.10'
          env:

        - python: '3.11'
          env:

        - python: '3.12'
          env:

        - python: '3.13-dev'
          env:
            - DILL="master"

        - python: 'pypy3.8-7.3.9' # at 7.3.11
          env:
            - MULTIPROCESS="true"

        - python: 'pypy3.9-7.3.9' # at 7.3.15
          env:
            - MULTIPROCESS="true"

        - python: 'pypy3.10-7.3.15'
          env:
            - MULTIPROCESS="true"

    allow_failures:
        - python: '3.13-dev'
        - python: 'pypy3.10-7.3.15' # CI missing
    fast_finish: true

cache:
    pip: true

before_install:
    - set -e  # fail on any error
    - if [[ $COVERAGE == "true" ]]; then pip install coverage; fi
    - if [[ $DILL == "master" ]]; then pip install "https://github.com/uqfoundation/dill/archive/master.tar.gz"; fi
    - if [[ $MULTIPROCESS == "true" ]]; then pip install multiprocess --no-binary multiprocess; fi

install:
    - python -m pip install .

script:
    - for test in pathos/tests/__init__.py; do echo $test ; if [[ $COVERAGE == "true" ]]; then coverage run -a $test > /dev/null; else python $test > /dev/null; fi ; done
    - for test in pathos/tests/test_*.py; do echo $test ; if [[ $COVERAGE == "true" ]]; then coverage run -a $test > /dev/null; else python $test > /dev/null; fi ; done

after_success:
    - if [[ $COVERAGE == "true" ]]; then bash <(curl -s https://codecov.io/bash); else echo ''; fi
    - if [[ $COVERAGE == "true" ]]; then coverage report; fi
