Skip to content

Commit

Permalink
Merge branch 'hotfix/fix-travis-settings' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeyeongYang committed Aug 31, 2019
2 parents 1c06776 + d7ca62c commit e4451b6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 47 deletions.
22 changes: 10 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Use cpp to enable both R & Python
language: cpp
language: r
r: release

sudo: required

Expand All @@ -14,19 +15,23 @@ branches:
- /hotfix\/.*/
- /bugfix\/.*/

env:
global:
# Don't treat missing suggested packages as error
- _R_CHECK_FORCE_SUGGESTS_=false

# Use cache for packages
cache:
apt: true
packages: true
directories:
- $HOME/miniconda3
- $HOME/R/Library

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- build-essential
- gcc-7
- g++-7
- gfortran-7
Expand All @@ -49,8 +54,8 @@ before_install:
- export MAKEFLAGS='-j 2'
- export CC=gcc-7
- export CXX=g++-7
- if [ "$TARGET" = "R" ]; then cd ./R; fi
- if [ "$TARGET" = "Python" ]; then cd ./Python; fi
- if [ "$TARGET" = "R" ]; then cd $ROOTPATH/R; fi
- if [ "$TARGET" = "Python" ]; then cd $ROOTPATH/Python; fi

install:
- source $ROOTPATH/travis/setup.sh
Expand All @@ -63,10 +68,3 @@ after_failure:

after_success:
- source $ROOTPATH/travis/after-success.sh

deploy:
provider: script
script: source $ROOTPATH/travis/deploy.sh
skip_cleanup: true
on:
branch: master
2 changes: 1 addition & 1 deletion travis/after-failure.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash

# Scripts for R
if [ "$TARGET" = "R" ]; then
Expand Down
2 changes: 1 addition & 1 deletion travis/after-success.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash

# Scripts for R
if [ "$TARGET" = "R" ]; then
Expand Down
11 changes: 0 additions & 11 deletions travis/deploy.sh

This file was deleted.

8 changes: 4 additions & 4 deletions travis/script.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
#!/bin/bash

# Scripts for R
if [ "$TARGET" = "R" ]; then
travis_wait 42 R CMD build . --no-build-vignettes --no-manual
travis_wait 59 R CMD check hBayesDM*.tar.gz --as-cran --no-build-vignettes --no-manual
travis_wait 59 R CMD build .
travis_wait 59 R CMD check hBayesDM*.tar.gz --no-tests

# Scripts for Python
elif [ "$TARGET" = "Python" ]; then
travis_wait 30 pytest tests/test_ra_prospect.py --reruns 5
pytest tests/test_ra_prospect.py --reruns 5

# Otherwise
else
Expand Down
21 changes: 3 additions & 18 deletions travis/setup.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
#!/usr/bin/env bash
#!/bin/bash

# Setup codes for R
if [ "$TARGET" = "R" ]; then
export R_LIBS_USER=~/R/Library
export R_LIBS_SITE=/usr/local/lib/R/site-library:/usr/lib/R/site-library
export _R_CHECK_CRAN_INCOMING_=false
export R_PROFILE=~/.Rprofile.site

# Add CRAN as an APT source
sudo echo 'deb https://cloud.r-project.org/bin/linux/ubuntu trusty-cran35/' >> /etc/apt/sources.list
sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
sudo apt-get update

# Install R with the latest version
sudo apt-get install -y -q --allow-unauthenticated r-base r-base-core r-base-dev
hash -r

# Setup a config for R
mkdir -p ~/.R/
echo "CC = ${CC}" >> ~/.R/Makevars
echo "CXX = ${CXX} -fPIC " >> ~/.R/Makevars
echo "CXX14 = ${CXX} -fPIC -flto=2" >> ~/.R/Makevars
echo "CXX14FLAGS = -mtune=native -march=native -Wno-ignored-attributes -O0" >> ~/.R/Makevars

# Install R packages
Rscript \
-e 'install.packages(c("devtools", "roxygen2", "testthat", "covr"), quiet = T, repos = "https://cran.rstudio.com")' \
-e 'devtools::install_deps(dep = T, quiet = T)'
-e 'install.packages("devtools", repos = "https://cloud.r-project.org/", quiet = TRUE)' \
-e 'devtools::install_deps(quiet = TRUE)'

# Setup codes for Python
elif [ "$TARGET" = "Python" ]; then
Expand Down

0 comments on commit e4451b6

Please sign in to comment.