Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions ci #198

Merged
merged 25 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
128 changes: 128 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: ci

on:
push:
branches:
- "master"
pull_request:
branches:
- "master"

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macOS-latest
- ubuntu-latest
python-version:
- 3.6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 3.6
# TODO: Python 2.7 tests were lost during migration from Travis to Github Actions
- 3.6

- 3.7
- 3.8
env:
CI_OS: ${{ matrix.os }}
PYVER: ${{ matrix.python-version }}
PACKAGE: forcebalance

steps:
- name: Checkout
uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
activate-environment: test
channel-priority: true
environment-file: devtools/conda-envs/test_env.yaml
auto-activate-base: false

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a

- name: Environment Information
shell: bash -l {0}
run: |
conda info --all
conda list

- name: Install OpenFF stack and OpenEye on Python 3.6+
if: ${{ matrix.python-version != 2.7}}
shell: bash -l {0}
run: |
conda install openforcefield -c conda-forge -c omnia -y

# Need to replace ndcctools with this block
# - name: Install Work Queue
# shell: bash -l {0}
# 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 GROMACS
shell: bash -l {0}
run: |
# This will not install double precision, needs to be replaced with a fresh build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's easy to lose the context of these sorts of comments

Suggested change
# This will not install double precision, needs to be replaced with a fresh build
# TODO: As a result of the move from Travis to GitHub Actions, the CI no longer builds
# GROMACS from source with double precision. This will need to be reverted so
# that the bromine test can return to its original strictness.

conda install gromacs -c bioconda -c conda-forge -y

- 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 "appending to GITHUB_PATH ... "
echo "$GITHUB_WORKSPACE/opt/tinker/8.8.3/bin" >> $GITHUB_PATH
echo "successfully appended to GITHUB_PATH"

- name: Extract data archives
run: |
cd studies/001_water_tutorial
tar xvjf targets.tar.bz2
cd ../../

- name: Install package
shell: bash -l {0}
run: |
# python setup.py install
python -m pip install --no-deps .
python -c "import forcebalance; print(forcebalance.__version__)"

- name: Run water study
shell: bash -l {0}
run: |
cd studies/001_water_tutorial
tar xvjf targets.tar.bz2
ForceBalance very_simple.in
cd ../../

- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=forcebalance --cov-config=setup.cfg --durations=0 --cov-report=xml

- name: Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
File renamed without changes.
1 change: 1 addition & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ dependencies:
#- openforcefield
#- openeye-toolkits

- ndcctools
2 changes: 1 addition & 1 deletion src/tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def setup_method(self, method):
self.logger.debug("\nSetting input file to '%s'\n" % self.input_file)
self.expected_results_name = "EXPECTED_BROMINE_RESULTS"
self.expected_results = EXPECTED_BROMINE_RESULTS
self.absolute_tolerance = 0.05
self.absolute_tolerance = 0.10

def test_bromine_study(self):
"""Check liquid bromine study converges to expected results"""
Expand Down
2 changes: 1 addition & 1 deletion src/tinkerio.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def calltinker(self, command, stdin=None, print_to_screen=False, print_command=F
if len(vw.split('.')) <= 2:
vn = float(vw)
else:
vn = float(vw.split('.')[:2])
vn = float(vw.split('.')[0]) + 0.1*float(vw.split('.')[1])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a fix for the known bug that @leeping mentioned in the slack chat. @leeping, to ensure that there's a paper trail, could you edit the PR description to include something like

- [x] Fixes <description of issue here>

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue was reported by a student in a private message but I don't think there's an issue corresponding to it.

vn_need = 6.3
try:
if vn < vn_need:
Expand Down