Permalink
Browse files

Added an initial travis configuration

  • Loading branch information...
1 parent 710fee7 commit b531386aa7b6cd1f07482c5f9f993ce96d3ac65c @ekmett committed Mar 8, 2013
Showing with 101 additions and 0 deletions.
  1. +1 −0 .ghci
  2. +26 −0 .travis.yml
  3. +31 −0 .vim.custom
  4. +27 −0 travis/cabal-apt-install
  5. +16 −0 travis/config
View
1 .ghci
@@ -0,0 +1 @@
+:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h -optP-Iincludes
View
@@ -0,0 +1,26 @@
+language: haskell
+before_install:
+ # Uncomment whenever hackage is down.
+ # - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && cabal update
+ - cabal update
+
+ # Try installing some of the build-deps with apt-get for speed.
+ - travis/cabal-apt-install $mode
+
+install:
+ - cabal configure -flib-Werror $mode
+ - cabal build
+
+script:
+ - $script && hlint src --cpp-define HLINT
+
+notifications:
+ irc:
+ channels:
+ - "irc.freenode.org#haskell-lens"
+ skip_join: true
+ template:
+ - "\x0313ersatz\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"
+
+env:
+ - mode="--enable-tests" script="cabal test --show-details=always"
View
@@ -0,0 +1,31 @@
+" Add the following to your .vimrc to automatically load this on startup
+
+" if filereadable(".vim.custom")
+" so .vim.custom
+" endif
+
+function StripTrailingWhitespace()
+ let myline=line(".")
+ let mycolumn = col(".")
+ silent %s/ *$//
+ call cursor(myline, mycolumn)
+endfunction
+
+" enable syntax highlighting
+syntax on
+
+" search for the tags file anywhere between here and /
+set tags=TAGS;/
+
+" highlight tabs and trailing spaces
+set listchars=tab:‗‗,trail:‗
+set list
+
+" f2 runs hasktags
+map <F2> :exec ":!hasktags -x -c --ignore src"<CR><CR>
+
+" strip trailing whitespace before saving
+" au BufWritePre *.hs,*.markdown silent! cal StripTrailingWhitespace()
+
+" rebuild hasktags after saving
+au BufWritePost *.hs silent! :exec ":!hasktags -x -c --ignore src"
View
@@ -0,0 +1,27 @@
+#! /bin/bash
+set -eu
+
+APT="sudo apt-get -q -y"
+CABAL_INSTALL_DEPS="cabal install --only-dependencies --force-reinstall"
+
+$APT update
+$APT install dctrl-tools
+
+# Find potential system packages to satisfy cabal dependencies
+deps()
+{
+ local M='^\([^ ]\+\)-[0-9.]\+ (.*$'
+ local G=' -o ( -FPackage -X libghc-\L\1\E-dev )'
+ local E="$($CABAL_INSTALL_DEPS "$@" --dry-run -v 2> /dev/null \
+ | sed -ne "s/$M/$G/p" | sort -u)"
+ grep-aptavail -n -sPackage \( -FNone -X None \) $E | sort -u
+}
+
+$APT install $(deps "$@") libghc-quickcheck2-dev # QuickCheck is special
+$CABAL_INSTALL_DEPS "$@" # Install the rest via Hackage
+
+if ! $APT install hlint ; then
+ $APT install $(deps hlint)
+ cabal install hlint
+fi
+
View
@@ -0,0 +1,16 @@
+-- This provides a custom ~/.cabal/config file for use when hackage is down that should work on unix
+--
+-- This is particularly useful for travis-ci to get it to stop complaining
+-- about a broken build when everything is still correct on our end.
+--
+-- This uses Luite Stegeman's mirror of hackage provided by his 'hdiff' site instead
+--
+-- To enable this, uncomment the before_script in .travis.yml
+
+remote-repo: hdiff.luite.com:http://hdiff.luite.com/packages/archive
+remote-repo-cache: ~/.cabal/packages
+world-file: ~/.cabal/world
+build-summary: ~/.cabal/logs/build.log
+remote-build-reporting: anonymous
+install-dirs user
+install-dirs global

0 comments on commit b531386

Please sign in to comment.