|
name: "Tests" |
|
on: |
|
pull_request: |
|
types: ['opened', 'synchronize', 'reopened', 'ready_for_review'] |
|
branches: |
|
- master |
|
- stable |
|
push: |
|
branches: |
|
- master |
|
tags: |
|
- "v*" |
|
schedule: |
|
- cron: "0 4 * * *" |
|
|
|
defaults: |
|
run: |
|
shell: bash -l {0} |
|
|
|
jobs: |
|
tests: |
|
runs-on: ubuntu-latest |
|
name: "Tests" |
|
strategy: |
|
# NOTE: When changing the test matrix: |
|
# * Update the after_n_builds in codecov.yml to match the number of |
|
# builds in the matrix |
|
# * You may need to create another example run for the notebook tests |
|
# (see examples/ipynbtests.sh; examples/prep_example_data.py). This |
|
# is because Python internals (usually bytecode, which is saved in |
|
# CVs) can differ between minor Python versions. |
|
matrix: |
|
CONDA_PY: |
|
- "3.13" |
|
- "3.12" |
|
- "3.11" |
|
MINIMAL: [""] |
|
include: |
|
- CONDA_PY: "3.11" |
|
MINIMAL: "minimal" |
|
|
|
steps: |
|
- uses: actions/checkout@v2 |
|
with: |
|
fetch-depth: 2 |
|
- uses: actions/setup-python@v2 |
|
- uses: conda-incubator/setup-miniconda@v3 |
|
with: |
|
auto-update-conda: true |
|
python-version: ${{ matrix.CONDA_PY }} |
|
miniforge-version: latest |
|
- name: "Install requirements" |
|
env: |
|
MINIMAL: ${{ matrix.MINIMAL }} |
|
CONDA_PY: ${{ matrix.CONDA_PY }} |
|
run: | |
|
if [ -z "$MINIMAL" ] ; then |
|
source devtools/conda_install_reqs.sh |
|
else |
|
# In this case we're actually double-installing (not just |
|
# installing requirements here). We prefer this to using the |
|
# conda_install_reqs script so we can test deps coming from PyPI |
|
python -m pip install -e .[test] |
|
fi |
|
python -m pip install autorelease |
|
- name: "Install" |
|
run: | |
|
python -m pip install --no-deps -e . |
|
- name: "Working directory" |
|
run: | |
|
pwd |
|
ls -l |
|
- name: "Check installation" |
|
run: | |
|
python -c "import openpathsampling; print(openpathsampling.version.full_version)" |
|
- name: "Versions" |
|
run: conda list |
|
- name: "Autorelease check" |
|
run: autorelease check --conf ./.autorelease/autorelease.yaml |
|
#- name: "DEBUG: enable SSH login" |
|
#uses: mxschmitt/action-tmate@v3 |
|
- name: "Unit Tests" |
|
env: |
|
PY_COLORS: "1" |
|
run: py.test -vv -s --cov --cov-report xml |
|
- name: "Tests: Experimental" |
|
if: matrix.MINIMAL == '' && matrix.CONDA_PY != '2.7' |
|
run: py.test openpathsampling/experimental/ -vv -s |
|
- uses: codecov/codecov-action@v4 |
|
env: |
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
|
- name: "Notebook tests" |
|
if: matrix.MINIMAL == '' |
|
run: | |
|
pushd examples/ && ./ipynbtests.sh || exit 1 && popd |