Skip to content

Commit

Permalink
Switch from Travis to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Dec 18, 2020
1 parent 14f9b53 commit aa5a075
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 43 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on: [push, pull_request]

jobs:
build:

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: [2.7, 3.7, 3.8, 3.9]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
KEY_MODELLER: ${{ secrets.KEY_MODELLER }}
run: |
tools/travis/install_deps.sh ${{ matrix.python-version }}
- name: Test
run: |
export CMAKE_INCLUDE_PATH=`pwd`/hdf5-inc
export CMAKE_LIBRARY_PATH=`pwd`/hdf5-libs
mkdir build && cd build
../tools/coverage/setup.py
PYTHONPATH=`pwd`/coverage cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-fprofile-arcs -ftest-coverage"
rm ../src/mdt_config.h
make
ctest --output-on-failure
- uses: codecov/codecov-action@v1
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![docs](https://readthedocs.org/projects/mdt/badge/)](https://salilab.org/mdt/doc/)
[![Build Status](https://api.travis-ci.org/salilab/mdt.svg?branch=develop)](https://travis-ci.org/salilab/mdt)
[![Build Status](https://github.com/salilab/mdt/workflows/build/badge.svg?branch=develop)](https://github.com/salilab/mdt/actions?query=workflow%3Abuild)
[![codecov](https://codecov.io/gh/salilab/mdt/branch/develop/graph/badge.svg)](https://codecov.io/gh/salilab/mdt)
[![Coverity scan](https://img.shields.io/coverity/scan/8502.svg)](https://scan.coverity.com/projects/salilab-mdt)

Expand Down
24 changes: 12 additions & 12 deletions tools/travis/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#!/bin/bash -e

# Install dependencies for Travis.
# Install dependencies for Travis or GitHub Actions.

if [ $# -ne 2 ]; then
echo "Usage: $0 python_version modeller_license_file"
if [ $# -ne 1 ]; then
echo "Usage: $0 python_version"
exit 1
fi

python_version=$1
modeller_license_file=$2
MODELLER_VERSION=9.24
MODELLER_VERSION=9.25
HDF5_VERSION=1.10.5
HDF5_SOVER=103
HDF5_HL_SOVER=100

sudo apt-get -qq update
sudo apt-get install -y swig bc
pip install coverage

# Install Modeller
modeller_url=https://salilab.org/modeller/${MODELLER_VERSION}
wget ${modeller_url}/modeller_${MODELLER_VERSION}-1_amd64.deb
export KEY_MODELLER=`cat ${modeller_license_file}`
sudo dpkg -i modeller_${MODELLER_VERSION}-1_amd64.deb
sudo --preserve-env=KEY_MODELLER dpkg -i modeller_${MODELLER_VERSION}-1_amd64.deb

# Modeller installs for system Python, so link its Python packages into the
# virtualenv Python path
virtualenv_dir=$(dirname $(which python))/..
ln -sf /usr/lib/python${python_version}/dist-packages/_modeller.so \
${virtualenv_dir}/lib/*/site-packages/
ln -sf /usr/lib/python${python_version}/dist-packages/modeller \
${virtualenv_dir}/lib/*/site-packages/
export PYTHON=`pip show coverage |grep Location|cut -b11-`
# Modeller 9.25 doesn't support Python 3.9 but the 3.8 extension
# should work
if [ "${python_version}" = "3.9" ]; then python_version=3.8; fi
ln -sf /usr/lib/python${python_version}/dist-packages/_modeller.so ${PYTHON}
ln -sf /usr/lib/python${python_version}/dist-packages/modeller ${PYTHON}

# Need to build MDT against the same version of HDF5 as Modeller, but Modeller
# only includes the HDF5 libraries, so we need to get the corresponding
Expand Down

0 comments on commit aa5a075

Please sign in to comment.