Fix vsite fits #475
Workflow file for this run
This file contains hidden or 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
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| pull_request: | |
| branches: | |
| - "master" | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }} (py=${{ matrix.python-version }}, gmx=${{ matrix.gmx-version }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - macOS-latest | |
| - ubuntu-latest | |
| python-version: | |
| - "3.9" | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| # pymbar 3 does not support Python 3.13 | |
| # - "3.13" | |
| gmx-version: | |
| - "5" | |
| - "2019" | |
| - "2024" | |
| - "2025" | |
| exclude: | |
| # a 2022 build doesn't seem to exist for mac | |
| - os: macOS-latest | |
| gmx-version: "2022" | |
| include: | |
| # just to test warnings | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| gmx-version: "4" | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| gmx-version: "2022" | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| gmx-version: "2023" | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| gmx-version: "2024.3" | |
| env: | |
| CI_OS: ${{ matrix.os }} | |
| PYVER: ${{ matrix.python-version }} | |
| GMXVER: ${{ matrix.gmx-version }} | |
| PACKAGE: forcebalance | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up conda environment with gromacs | |
| if: (matrix.gmx-version != '5' && matrix.gmx-version != '4' && matrix.gmx-version != '2022' && matrix.gmx-version != '2023') && (matrix.python-version == '3.9' || matrix.python-version == '3.10') | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| # Use a reduced legacy environment for Python 3.9/3.10 builds. | |
| environment-file: devtools/conda-envs/test_env_py39.yaml | |
| create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces | |
| python=${{ matrix.python-version }} | |
| - name: Set up conda environment for Python 3.11 or higher | |
| uses: mamba-org/setup-micromamba@v1 | |
| if: (matrix.python-version != '3.9' && matrix.python-version != '3.10') && (matrix.gmx-version != '5' && matrix.gmx-version != '4' && matrix.gmx-version != '2022' && matrix.gmx-version != '2023') | |
| with: | |
| environment-file: devtools/conda-envs/test_env.yaml | |
| create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces | |
| python=${{ matrix.python-version }} gromacs=${{ matrix.gmx-version }}.*=nompi_dblprec* | |
| - name: Set up conda environment without gromacs | |
| if: matrix.gmx-version == '5' || matrix.gmx-version == '4' | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| # Use the legacy env for Python 3.9/3.10, full env otherwise. | |
| environment-file: ${{ (matrix.python-version == '3.9' || matrix.python-version == '3.10') && 'devtools/conda-envs/test_env_py39.yaml' || 'devtools/conda-envs/test_env.yaml' }} | |
| create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces | |
| python=${{ matrix.python-version }} | |
| - name: Set up conda environment with single-precision gromacs (rejected versions) | |
| if: matrix.gmx-version == '2022' || matrix.gmx-version == '2023' | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| # dblprec conda-forge builds don't exist for 2022/2023; single-precision is sufficient | |
| # for the version-rejection test. | |
| # Use the legacy env for Python 3.9/3.10, full env otherwise. | |
| environment-file: ${{ (matrix.python-version == '3.9' || matrix.python-version == '3.10') && 'devtools/conda-envs/test_env_py39.yaml' || 'devtools/conda-envs/test_env.yaml' }} | |
| create-args: >- | |
| python=${{ matrix.python-version }} gromacs=${{ matrix.gmx-version }} | |
| - name: Pin setuptools for Python <= 3.10 | |
| if: matrix.python-version == '3.9' || matrix.python-version == '3.10' | |
| shell: bash -l {0} | |
| run: pip install "setuptools<82" | |
| - name: Additional info about the build | |
| shell: bash | |
| run: | | |
| uname -a | |
| df -h | |
| ulimit -a | |
| - name: Environment Information | |
| run: | | |
| micromamba info | |
| micromamba list | |
| # Need to replace ndcctools with this block | |
| # - name: Install Work Queue | |
| # run: | | |
| # wget https://raw.githubusercontent.com/leeping/forcebalance/master/tools/install-cctools.sh | |
| # bash install-cctools.sh | |
| # echo "Checking for Work Queue import; if successful, no message will be printed" | |
| # python -c "import work_queue" | |
| # export PATH="$GITHUB_WORKSPACE/opt/cctools/current/bin:$PATH" | |
| - name: Install Tinker | |
| run: | | |
| if [[ "$CI_OS" == 'ubuntu-latest' ]]; then | |
| wget https://dasher.wustl.edu/tinker/downloads/bin-linux-8.8.3.tar.gz -O tinker.tar.gz | |
| fi | |
| if [[ "$CI_OS" == 'macOS-latest' ]]; then | |
| wget https://dasher.wustl.edu/tinker/downloads/bin-macos-8.8.3.tar.gz -O tinker.tar.gz | |
| fi | |
| tar xvzf tinker.tar.gz &> untar.log | |
| mkdir -p $GITHUB_WORKSPACE/opt/tinker/8.8.3 | |
| if [[ "$CI_OS" == 'ubuntu-latest' ]]; then | |
| mv bin-linux $GITHUB_WORKSPACE/opt/tinker/8.8.3/bin | |
| fi | |
| if [[ "$CI_OS" == 'macOS-latest' ]]; then | |
| mv bin-macos $GITHUB_WORKSPACE/opt/tinker/8.8.3/bin | |
| fi | |
| echo "$GITHUB_WORKSPACE/opt/tinker/8.8.3/bin" >> $GITHUB_PATH | |
| - name: Install Gromacs | |
| if: matrix.gmx-version == '5' | |
| run: | | |
| wget http://ftp.gromacs.org/pub/gromacs/gromacs-5.1.5.tar.gz | |
| tar xvzf gromacs-5.1.5.tar.gz | |
| cd gromacs-5.1.5 | |
| cp -r cmake cmake_s | |
| cd cmake | |
| cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/opt/gromacs/5.1.5 -DGMX_DOUBLE=ON -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DGMX_USE_RDTSCP=OFF -DGMX_SIMD=None .. | |
| # replace http:/w with https://w | |
| sed -i.bak 's|http:/w|https://w|g' CMakeCache.txt && rm -f CMakeCache.txt.bak | |
| make -j 8 && make install | |
| cd ../cmake_s | |
| cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/opt/gromacs/5.1.5 -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DGMX_USE_RDTSCP=OFF -DGMX_SIMD=None .. | |
| sed -i.bak 's|http:/w|https://w|g' CMakeCache.txt && rm -f CMakeCache.txt.bak | |
| make -j 8 && make install | |
| cd .. | |
| . $GITHUB_WORKSPACE/opt/gromacs/5.1.5/bin/GMXRC.bash | |
| echo "$GITHUB_WORKSPACE/opt/gromacs/5.1.5/bin" >> $GITHUB_PATH | |
| which gmx | |
| which gmx_d | |
| gmx help | |
| gmx dump -h | |
| - name: Install Gromacs | |
| if: matrix.gmx-version == '4' | |
| run: | | |
| wget http://ftp.gromacs.org/pub/gromacs/gromacs-4.6.7.tar.gz | |
| tar xvzf gromacs-4.6.7.tar.gz | |
| cd gromacs-4.6.7 | |
| cp -r cmake cmake_s | |
| cd cmake | |
| cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/opt/gromacs/4.6.7 -DGMX_DOUBLE=ON -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DGMX_USE_RDTSCP=OFF -DGMX_SIMD=None .. | |
| # replace http:/w with https://w | |
| sed -i.bak 's|http:/w|https://w|g' CMakeCache.txt && rm -f CMakeCache.txt.bak | |
| make -j 8 && make install | |
| cd ../cmake_s | |
| cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/opt/gromacs/4.6.7 -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DGMX_USE_RDTSCP=OFF -DGMX_SIMD=None .. | |
| sed -i.bak 's|http:/w|https://w|g' CMakeCache.txt && rm -f CMakeCache.txt.bak | |
| make -j 8 && make install | |
| cd .. | |
| . $GITHUB_WORKSPACE/opt/gromacs/4.6.7/bin/GMXRC.bash | |
| echo "$GITHUB_WORKSPACE/opt/gromacs/4.6.7/bin" >> $GITHUB_PATH | |
| which mdrun | |
| - name: Extract data archives | |
| run: | | |
| cd studies/001_water_tutorial | |
| tar xvjf targets.tar.bz2 | |
| cd ../../ | |
| - name: Install package | |
| run: | | |
| python -m pip install --no-deps . | |
| python -c "import forcebalance; print(forcebalance.__version__)" | |
| - name: Run version-rejection test | |
| if: matrix.gmx-version == '4' || matrix.gmx-version == '2022' || matrix.gmx-version == '2023' || matrix.gmx-version == '2024.3' | |
| run: | | |
| pytest -v --run-gmx-rejected -k test_gmx_version_rejected src/tests/test_gmxio.py | |
| - name: Run tests | |
| if: matrix.gmx-version != '4' && matrix.gmx-version != '2022' && matrix.gmx-version != '2023' && matrix.gmx-version != '2024.3' | |
| run: | | |
| pytest -v --cov=forcebalance --cov-config=setup.cfg --durations=0 --cov-report=xml --timeout=2000 src/tests/ | |
| - name: Run water study | |
| if: matrix.gmx-version != '4' && matrix.gmx-version != '2022' && matrix.gmx-version != '2023' && matrix.gmx-version != '2024.3' | |
| run: | | |
| cd studies/001_water_tutorial | |
| tar xvjf targets.tar.bz2 | |
| ForceBalance very_simple.in | |
| cd ../../ | |
| - name: Codecov | |
| if: matrix.gmx-version != '4' && matrix.gmx-version != '2022' && matrix.gmx-version != '2023' && matrix.gmx-version != '2024.3' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false |