Skip to content

Commit

Permalink
Set up GitHub Actions CI (#367)
Browse files Browse the repository at this point in the history
* MAINT: Bump Python versions in CI

* Set up GitHub Actions CI

* Fix test env name

* Drop coverage in tests and Python 3.8

* Add travis back, update miniconda URL

* curl -> wget

* Fix URL

* Fix env name

* Fix typo

* Fix typo

* Update script to cookiecutter

* Fix brew
  • Loading branch information
mattwthompson authored Sep 29, 2020
1 parent 23ef90c commit 1667be2
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 25 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ci

on:
push:
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.6, 3.7]
env:
CI_OS: ${{ matrix.os }}
PYVER: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2

- uses: goanpeca/setup-miniconda@v1
with:
python-version: ${{ matrix.python-version }}
activate-environment: intermol-test-env
mamba-version: "*"
channels: conda-forge,omnia,bioconda,defaults
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
conda list
- name: Install package
shell: bash -l {0}
run: |
python -m pip install --no-deps .
- name: Run tests
shell: bash -l {0}
run: |
pytest --pyargs intermol -v
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@ sudo: false

matrix:
include:
- { os: linux, env: PYTHON_VERSION=2.7 }
- { os: linux, env: PYTHON_VERSION=3.4 }
- { os: linux, env: PYTHON_VERSION=3.5 }
- { os: osx, env: PYTHON_VERSION=2.7 }
- { os: osx, env: PYTHON_VERSION=3.4 }
- { os: osx, env: PYTHON_VERSION=3.5 }
- { os: linux, env: PYTHON_VERSION=3.6 }
- { os: linux, env: PYTHON_VERSION=3.7 }
- { os: osx, env: PYTHON_VERSION=3.6 }
- { os: osx, env: PYTHON_VERSION=3.7 }

install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install md5sha1sum; fi
- source devtools/travis-ci/install_conda.sh

- conda config --set always_yes yes --set changeps1 no
- conda env create -q -n test-environment python=$PYTHON_VERSION -f environment.yml
- source activate test-environment
- conda env create -q python=$PYTHON_VERSION -f devtools/conda-envs/test_env.yaml
- source activate intermol-test-env
- pip install -e .

script:
Expand Down
20 changes: 20 additions & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: intermol-test-env
channels:
- conda-forge
- omnia
- bioconda
- defaults
dependencies:
# Core
- numpy
- parmed
- openmm
- six

# Engines
- ambertools
- gromacs
- lammps

# Testing
- pytest
15 changes: 11 additions & 4 deletions devtools/travis-ci/install_conda.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/bash

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then MINICONDA=Miniconda3-latest-MacOSX-x86_64.sh; fi
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MINICONDA=Miniconda3-latest-Linux-x86_64.sh; fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
# Make OSX md5 mimic md5sum from linux, alias does not work
md5sum () {
command md5 -r "$@"
}
MINICONDA=Miniconda3-latest-MacOSX-x86_64.sh
else
MINICONDA=Miniconda3-latest-Linux-x86_64.sh
fi

MINICONDA_MD5=$(curl -s https://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
wget https://repo.continuum.io/miniconda/$MINICONDA
MINICONDA_MD5=$(wget -qO- https://repo.anaconda.com/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
wget -q https://repo.anaconda.com/miniconda/$MINICONDA
if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
echo "Miniconda MD5 mismatch"
exit 1
Expand Down
12 changes: 0 additions & 12 deletions environment.yml

This file was deleted.

0 comments on commit 1667be2

Please sign in to comment.