name: CI on: push: branches: - 'main' - 'pymbar4' - 'gha' pull_request: branches: - 'main' - 'pymbar4' - 'gha' schedule: # Nightly Tests - cron: '0 0 * * *' defaults: run: shell: bash -leo pipefail {0} concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: test: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macOS-latest, ubuntu-latest, windows-latest] python-version: ["3.11", "3.12", "3.13", "3.14"] # Check against oldest and newest versions jax: ["", "_jax"] exclude: # Skip win + jax - jax: "_jax" os: windows-latest env: PYVER: ${{ matrix.python-version }} CI_OS: ${{ matrix.os }} PACKAGE: "pymbar" steps: - name: Checkout the code uses: actions/checkout@v4 - name: Additional info about the build shell: bash run: | uname -a df -h ulimit -a - name: Setup Conda via Mamba uses: mamba-org/setup-micromamba@v1 with: environment-file: devtools/conda-envs/test_env${{ matrix.jax }}.yaml environment-name: test condarc: | channels: - conda-forge create-args: >- python=${{ matrix.python-version }} - name: Install package run: | python -m pip install . --no-deps micromamba list - name: Run tests (pytest) run: | pytest -v --cov=$PACKAGE --cov-report=xml --color=yes --doctest-modules $PACKAGE/ - name: Run examples run: | ### constant-force-optical-trap cd examples/constant-force-optical-trap python extract-data.py python force-bias-optical-trap.py ### harmonic-oscillators cd ../harmonic-oscillators python harmonic-oscillators.py python harmonic-oscillators-distributions.py cd ../heat-capacity python heat-capacity.py -b 2 ### parallel-tempering-2dfes cd ../parallel-tempering-2dfes python parallel-tempering-2dfes.py ### umbrella-sampling-fes cd ../umbrella-sampling-fes python umbrella-sampling.py python umbrella-sampling-advanced-fes.py - name: CodeCov uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml flags: unittests lint-format: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.11"] env: PACKAGE: "pymbar" steps: - name: Checkout the code uses: actions/checkout@v1 - name: Setup Conda via Mamba uses: mamba-org/setup-micromamba@v1 with: environment-file: devtools/conda-envs/test_env.yaml environment-name: test condarc: | channels: - conda-forge create-args: >- python=${{ matrix.python-version }} - name: Install linter and formatter run: | micromamba install pylint black - name: Run pylint run: | pylint $PACKAGE/ # Black has a default --exclude which reads .gitignore. # Black's --exclude and --extend-exclude are single specified RegEx patterns and overwrite if multi-marked. - name: Run black check if: always() run: | black --check -l 99 $PACKAGE/ examples/