diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..b31160f9 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml index c369d4ca..577b6b3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml new file mode 100644 index 00000000..73184d87 --- /dev/null +++ b/devtools/conda-envs/test_env.yaml @@ -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 diff --git a/devtools/travis-ci/install_conda.sh b/devtools/travis-ci/install_conda.sh index 9fd777eb..9cdc9754 100755 --- a/devtools/travis-ci/install_conda.sh +++ b/devtools/travis-ci/install_conda.sh @@ -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> */\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> */\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 diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 531f100a..00000000 --- a/environment.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: test-environment -channels: -- omnia -- conda-forge -- defaults -dependencies: -- numpy -- parmed -- openmm -- six -# Testing Deps -- pytest >=3.0