Skip to content

Commit 76896c8

Browse files
committed
use Docker based travis config
- mostly copied from https://github.com/KristofferC/PGFPlotsX.jl - using Debian Slim + SCIP requirements for Docker
1 parent 1d53fe9 commit 76896c8

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

.travis.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ os:
44
- linux
55
julia:
66
- 0.6
7-
notifications:
8-
email: false
9-
sudo: required
107
dist: trusty
8+
sudo: required
9+
services:
10+
- docker
1111
before_install:
12-
- wget http://scip.zib.de/download/release/SCIPOptSuite-5.0.1-Linux.deb
13-
- sudo dpkg -i SCIPOptSuite-5.0.1-Linux.deb
12+
- echo "**** pulling Docker image"
13+
- docker pull leethargo/debian4scip
14+
notifications:
15+
email: false
1416
script:
15-
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
16-
- julia -e 'Pkg.clone(pwd())'
17-
- export SCIPOPTDIR="/usr"
18-
- julia -e 'Pkg.build("SCIP"); Pkg.test("SCIP"; coverage=true)'
17+
- echo "**** running Docker"
18+
- docker run --env-file travis_docker_env.list -t -a STDOUT -a STDIN -a STDERR -v $PWD:/mnt leethargo/debian4scip /mnt/travis_docker_test_script.sh $TRAVIS_JULIA_VERSION

travis_docker_env.list

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# environment variables that are passed from Travis to Docker
2+
DOCUMENTER_KEY
3+
TRAVIS_BRANCH
4+
TRAVIS_PULL_REQUEST
5+
TRAVIS_REPO_SLUG
6+
TRAVIS_TAG
7+
TRAVIS_OS_NAME
8+
TRAVIS_JULIA_VERSION
9+
# comment this out to debug Documenter.jl
10+
# DOCUMENTER_DEBUG=true

travis_docker_test_script.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# the first and only argument to the script is the version
4+
JULIAVER=$1
5+
JULIABIN=/test/julia-$JULIAVER/bin/julia
6+
PKGNAME="SCIP"
7+
8+
## install the image (when necessary)
9+
/test/install-julia.sh $JULIAVER
10+
11+
cd /mnt && if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
12+
13+
# run tests
14+
$JULIABIN -e "Pkg.clone(\"/mnt/\", \"$PKGNAME\"); Pkg.build(\"$PKGNAME\"); Pkg.test(\"$PKGNAME\"; coverage=true)"
15+
TEST_EXIT=$? # return with this
16+
17+
# save coverage results back to host
18+
PKGDIR=`$JULIABIN -e "print(Pkg.dir(\"$PKGNAME\"))"`
19+
rsync -mav --include="*/" --include="*.cov" --exclude="*" $PKGDIR/ /mnt/
20+
exit $TEST_EXIT

0 commit comments

Comments
 (0)