Skip to content

Commit 1667be2

Browse files
Set up GitHub Actions CI (#367)
* 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
1 parent 23ef90c commit 1667be2

File tree

5 files changed

+90
-25
lines changed

5 files changed

+90
-25
lines changed

.github/workflows/ci.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [macOS-latest, ubuntu-latest]
14+
python-version: [3.6, 3.7]
15+
env:
16+
CI_OS: ${{ matrix.os }}
17+
PYVER: ${{ matrix.python-version }}
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- uses: goanpeca/setup-miniconda@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
activate-environment: intermol-test-env
26+
mamba-version: "*"
27+
channels: conda-forge,omnia,bioconda,defaults
28+
channel-priority: true
29+
environment-file: devtools/conda-envs/test_env.yaml
30+
auto-activate-base: false
31+
32+
- name: Additional info about the build
33+
shell: bash
34+
run: |
35+
uname -a
36+
df -h
37+
ulimit -a
38+
39+
- name: Environment Information
40+
shell: bash -l {0}
41+
run: |
42+
conda info
43+
conda list
44+
45+
- name: Install package
46+
shell: bash -l {0}
47+
run: |
48+
python -m pip install --no-deps .
49+
50+
- name: Run tests
51+
shell: bash -l {0}
52+
run: |
53+
pytest --pyargs intermol -v

.travis.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@ sudo: false
33

44
matrix:
55
include:
6-
- { os: linux, env: PYTHON_VERSION=2.7 }
7-
- { os: linux, env: PYTHON_VERSION=3.4 }
8-
- { os: linux, env: PYTHON_VERSION=3.5 }
9-
- { os: osx, env: PYTHON_VERSION=2.7 }
10-
- { os: osx, env: PYTHON_VERSION=3.4 }
11-
- { os: osx, env: PYTHON_VERSION=3.5 }
6+
- { os: linux, env: PYTHON_VERSION=3.6 }
7+
- { os: linux, env: PYTHON_VERSION=3.7 }
8+
- { os: osx, env: PYTHON_VERSION=3.6 }
9+
- { os: osx, env: PYTHON_VERSION=3.7 }
1210

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

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

2219
script:

devtools/conda-envs/test_env.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: intermol-test-env
2+
channels:
3+
- conda-forge
4+
- omnia
5+
- bioconda
6+
- defaults
7+
dependencies:
8+
# Core
9+
- numpy
10+
- parmed
11+
- openmm
12+
- six
13+
14+
# Engines
15+
- ambertools
16+
- gromacs
17+
- lammps
18+
19+
# Testing
20+
- pytest

devtools/travis-ci/install_conda.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/bash
22

3-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then MINICONDA=Miniconda3-latest-MacOSX-x86_64.sh; fi
4-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MINICONDA=Miniconda3-latest-Linux-x86_64.sh; fi
3+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
4+
# Make OSX md5 mimic md5sum from linux, alias does not work
5+
md5sum () {
6+
command md5 -r "$@"
7+
}
8+
MINICONDA=Miniconda3-latest-MacOSX-x86_64.sh
9+
else
10+
MINICONDA=Miniconda3-latest-Linux-x86_64.sh
11+
fi
512

6-
MINICONDA_MD5=$(curl -s https://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
7-
wget https://repo.continuum.io/miniconda/$MINICONDA
13+
MINICONDA_MD5=$(wget -qO- https://repo.anaconda.com/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
14+
wget -q https://repo.anaconda.com/miniconda/$MINICONDA
815
if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
916
echo "Miniconda MD5 mismatch"
1017
exit 1

environment.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)