diff --git a/.travis.yml b/.travis.yml index c8f0f781..c155e136 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,27 @@ language: julia -sudo: false -os: - - linux - - osx -julia: - - 0.5 - - 0.6 - - nightly +sudo: required +services: + - docker +git: + depth: 99999999 + +matrix: + include: + - os: linux + julia: 0.5 + - os: linux + julia: 0.6 + - os: linux + julia: nightly + - os: osx + julia: 0.5 + - os: osx + julia: 0.6 + - os: osx + julia: nightly + - os: linux + julia: 0.6 + env: DOCKER_BUILD=true notifications: email: false addons: @@ -16,12 +31,7 @@ addons: - xauth - libgtk-3-0 script: - - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - if [[ `uname` = "Linux" ]]; then TESTCMD="xvfb-run julia"; else TESTCMD="julia"; fi - - $TESTCMD -e 'Pkg.clone(pwd()); using BinDeps; - println(BinDeps.debug("Gtk")); - Pkg.build("Gtk"); - Pkg.test("Gtk"; coverage=true)' + - ./travis-script.sh after_success: - julia -e 'cd(Pkg.dir("Gtk")); Pkg.add("Coverage"); diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3c93d26a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,59 @@ +# Derived from https://github.com/docker-library/julia which is distributed +# under the terms of the MIT Expat license and is +# Copyright (c) 2014-2015 Docker, Inc. + + +# FROM ubuntu:trusty-20171117 +FROM ubuntu:xenial-20171114 +# FROM ubuntu:zesty-20171114 +# FROM ubuntu:artful-20171116 +# FROM debian:jessie + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl + +ENV JULIA_PATH /usr/local/julia + +# https://julialang.org/downloads/ +ENV JULIA_VERSION 0.6.1 + +RUN set -ex; \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-0.6.1.sha256 +# this "case" statement is generated via "update.sh" + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) tarArch='x86_64'; dirArch='x64'; sha256='d73f988b4d5889b30063f40c2f9ad4a2487f0ea87d6aa0b8ed53e789782bb323' ;; \ + armhf) tarArch='armv7l'; dirArch='armv7l'; sha256='ee2cea5a6e5763fb2ef38b585560000c7fb2cee9a7e2330d4eae278beed4d7e6' ;; \ + arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='945c1657ca4a8d76b7136829cf06dddbd5343dfdfa6b20d2308ae0dc08c5ca79' ;; \ + i386) tarArch='i686'; dirArch='x86'; sha256='88cf40e45558958f9a23540d52209fd050d82512bbbe8dec03db7d0976cc645a' ;; \ + *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ + esac; \ + curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${JULIA_VERSION%[.-]*}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ + curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${JULIA_VERSION%[.-]*}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz + + +ENV PATH $JULIA_PATH/bin:$PATH + +# Copy the current directory contents into the container at /app +ADD . /Gtk + +# Set the working directory to /app +WORKDIR /Gtk + +RUN echo 'APT::Get::Assume-Yes "true";' | tee -a /etc/apt/apt.conf.d/00Do-not-ask + +RUN julia -e "Pkg.init()" +RUN DEBIAN_FRONTEND=noninteractive julia -e "Pkg.clone(pwd()); Pkg.build(\"Gtk\")" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + xvfb \ + xauth + +RUN xvfb-run julia -e "Pkg.test(\"Gtk\")" diff --git a/deps/build.jl b/deps/build.jl index 5b3351bf..81817c46 100755 --- a/deps/build.jl +++ b/deps/build.jl @@ -17,7 +17,7 @@ deps = [ ] if @compat is_linux() - provides(AptGet, "libgtk-3-0", deps) + provides(AptGet, "libgtk-3-dev", deps) provides(Yum, "gtk3", deps) end diff --git a/travis-script.sh b/travis-script.sh new file mode 100755 index 00000000..30afe788 --- /dev/null +++ b/travis-script.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -ex + +if [[ "$DOCKER_BUILD" = true ]]; then + docker build -t gtkjl . +else + if [[ `uname` = "Linux" ]]; then + TESTCMD="xvfb-run julia" + else + TESTCMD="julia" + fi + $TESTCMD -e 'Pkg.clone(pwd()); using BinDeps; + println(BinDeps.debug("Gtk")); + Pkg.build("Gtk"); + Pkg.test("Gtk"; coverage=true)' +fi \ No newline at end of file