Add Travis support
authorDavid Luposchainsky <dluposchainsky@gmail.com>
Mon, 4 Jan 2016 17:20:23 +0000 (18:20 +0100)
committerDavid Luposchainsky <dluposchainsky@gmail.com>
Mon, 4 Jan 2016 18:37:51 +0000 (19:37 +0100)
.travis.yml [new file with mode: 0644]
.travis/install-cabal-happy-alex.sh [new file with mode: 0755]
.travis/install-ghc-shake.sh [new file with mode: 0755]
.travis/install-ghc.sh [new file with mode: 0755]
.travis/print-env.sh [new file with mode: 0755]
.travis/run-ghc-shake.sh [new file with mode: 0755]
README.md

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..5e169fa
--- /dev/null
@@ -0,0 +1,32 @@
+sudo: false
+
+matrix:
+  include:
+    - env: CABALVER=1.22 GHCVER=7.10.3
+      addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,zlib1g-dev,terminfo-dev],  sources: [hvr-ghc]}}
+
+before_install:
+
+    - PATH="$HOME/.cabal/bin:$PATH"
+    - PATH="/opt/ghc/$GHCVER/bin:$PATH"
+    - PATH="/opt/cabal/$CABALVER/bin:$PATH"
+    - export PATH
+
+    - .travis/print-env.sh
+
+install:
+    - .travis/install-cabal-happy-alex.sh
+    - .travis/install-ghc.sh
+    - .travis/install-ghc-shake.sh
+
+script:
+    - .travis/run-ghc-shake.sh
+
+cache:
+    directories:
+        - $HOME/.cabal
+        # - ghc/shake-build/.cabal-sandbox
+        # - ghc/shake-build/cabal.sandbox.config
+
+# before_cache:
+#     - rm -rf ghc/shake-build
diff --git a/.travis/install-cabal-happy-alex.sh b/.travis/install-cabal-happy-alex.sh
new file mode 100755 (executable)
index 0000000..93df460
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+COLOR="\e[32m" # Green
+RESET="\e[m"
+
+echo -e "${COLOR}GHC version:${RESET}"
+ghc --version
+
+echo -e "${COLOR}Cabal version:${RESET}"
+cabal --version
+
+echo -e "${COLOR}Update Cabal${RESET}"
+cabal update
+
+echo -e "${COLOR}Install Alex+Happy${RESET}"
+cabal install alex happy
diff --git a/.travis/install-ghc-shake.sh b/.travis/install-ghc-shake.sh
new file mode 100755 (executable)
index 0000000..2dc0392
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+COLOR="\e[31m" # Red, because this file is serious business
+RESET="\e[m"
+
+echo -e "${COLOR}Brutally hacking GHC-Shake to its proper location${RESET}"
+SHAKEDIR="ghc/shake-build"
+mkdir -p "$SHAKEDIR"
+mv .git "$SHAKEDIR/"
+( cd "$SHAKEDIR" && git reset --hard HEAD )
+
+echo -e "${COLOR}Installing deps into sandbox${RESET}"
+( cd "$SHAKEDIR" && cabal sandbox init )
+( cd "$SHAKEDIR" && cabal install --only-dependencies . )
diff --git a/.travis/install-ghc.sh b/.travis/install-ghc.sh
new file mode 100755 (executable)
index 0000000..126cbe2
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+COLOR="\e[34m" # Blue
+RESET="\e[m"
+
+echo -e "${COLOR}Clone GHC source${RESET}"
+git clone git://git.haskell.org/ghc
+
+echo -e "${COLOR}Initialize GHC submodules${RESET}"
+( cd ghc && git submodule update --init )
+
+echo -e "${COLOR}GHC boot/configure${RESET}"
+( cd ghc && ./boot && ./configure)
diff --git a/.travis/print-env.sh b/.travis/print-env.sh
new file mode 100755 (executable)
index 0000000..c09c11f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+COLOR="\e[32m" # Green
+RESET="\e[m"
+
+echo -e "${COLOR}Environment:${RESET}"
+env
diff --git a/.travis/run-ghc-shake.sh b/.travis/run-ghc-shake.sh
new file mode 100755 (executable)
index 0000000..7b867b7
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+COLOR="\e[32m" # Green
+RESET="\e[m"
+
+echo -e "${COLOR}Running Shake build system${RESET}"
+( cd ghc && ./shake-build/build.cabal.sh )
index f26cc49..43b74be 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
 Shaking up GHC
 ==============
 
+[![Build Status](https://travis-ci.org/snowleopard/shaking-up-ghc.svg)](https://travis-ci.org/snowleopard/shaking-up-ghc)
+
 As part of my 6-month research secondment to Microsoft Research in Cambridge
 I am taking up the challenge of migrating the current [GHC][ghc] build system
 based on standard `make` into a new and (hopefully) better one based on