@@ -1,13 +1,49 @@
1−notifications:
1+# See https://github.com/harendra-kumar/packcheck for all options and their
2− email: false
2+# explanation.
5+ # ------------------------------------------------------------------------
6+ # Global options used for all CI tests
7+ # ------------------------------------------------------------------------
6− - GHC_OPTIONS="-O0 -Werror"
8+ - GHC_OPTIONS="-Werror"
7− - PACKCHECK="./packcheck.sh"
9+ # ------------------------------------------------------------------------
8− # The commit id of packcheck.sh to use from harendra-kumar/packcheck on github
10+ # Options for builds that need stack
9− - PACKCHECK_COMMIT="c028c2425a372487e74157569d0a6cd4d745575d"
11+ # ------------------------------------------------------------------------
14+ # ------------------------------------------------------------------------
15+ # Other options: Normally you would not need to customize these
16+ # ------------------------------------------------------------------------
17+ - CABAL_REINIT_CONFIG=y
18+ - CABAL_CHECK_RELAX=y
20+ - CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com
24+ # ------------------------------------------------------------------------
25+ # Location of packcheck.sh (the shell script invoked to perform CI tests ).
26+ # ------------------------------------------------------------------------
27+ # You can either commit the packcheck.sh script at this path in your repo or
28+ # you can use it by specifying the PACKCHECK_REPO_URL option below in which
29+ # case it will be automatically copied from the packcheck repo to this path
30+ # during CI tests. In any case it is finally invoked from this path.
31+ - PACKCHECK_LOCAL_PATH="./packcheck.sh"
32+ # If you have not committed packcheck.sh in your repo at PACKCHECK_LOCAL_PATH
33+ # then it is automatically pulled from this URL.
34+ - PACKCHECK_GITHUB_URL="https://raw.githubusercontent.com/harendra-kumar/packcheck"
35+ - PACKCHECK_GITHUB_COMMIT="da9d6da3d18d6250c06617817f0879324c75c224"
40+# This matrix has total 11 builds enabled, 4 builds each (3 last major compiler
41+# versions and head) for stack and cabal, 2 OSX builds (stack and cabal for
42+# latest compiler version), and one hlint build. You may want to comment out
43+# some of the builds to be lighter on the CI infrastructure.
45+# We pre-install the cabal-install package to not incur the penalty of building
46+# it the first time in cached builds or every time in uncached builds.
@@ -15,59 +51,66 @@ matrix:
15 # (Linux) stack builds
51 # (Linux) stack builds
16 # --------------------------------------------------------------------------
52 # --------------------------------------------------------------------------
19− - env: BUILD=stack RESOLVER=lts-6.35 STACK_YAML=stack-7.10.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
54+ - env: BUILD=stack CABALVER=1.22 GHCVER=7.10.3 RESOLVER=lts-6 STACK_YAML=stack-7.10.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
20− addons: {apt: {packages: [libsdl1.2-dev]}}
55+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,libsdl1.2-dev], sources: [hvr-ghc]}}
23− - env: BUILD=stack RESOLVER=lts-9.20 STACK_YAML=stack-8.0.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
57+ - env: BUILD=stack CABALVER=1.24 GHCVER=8.0.2 RESOLVER=lts-9 STACK_YAML=stack-8.0.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
24− addons: {apt: {packages: [libsdl1.2-dev]}}
58+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,libsdl1.2-dev], sources: [hvr-ghc]}}
27− - env: BUILD=stack RESOLVER=lts-10.0 STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
60+ - env: BUILD=stack CABALVER=2.0 GHCVER=8.2.2 RESOLVER=lts-10 STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
28− addons: {apt: {packages: [libsdl1.2-dev]}}
61+ addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,libsdl1.2-dev], sources: [hvr-ghc]}}
31 - env: BUILD=stack RESOLVER=nightly
64 - env: BUILD=stack RESOLVER=nightly
66+ # Using a custom stack-yaml config file.
67+ #- env: BUILD=stack STACK_YAML=.ci/stack-8.0.yaml
69+ # You can customize a stack build even without a custom stack-yaml
70+ # using STACK_OPTIONS, STACK_BUILD_OPTIONS, GHC_OPTIONS etc.
71+ #- env: BUILD=stack RESOLVER=lts-10.0 STACK_BUILD_OPTIONS="--flag packcheck:dev"
33 # --------------------------------------------------------------------------
73 # --------------------------------------------------------------------------
34 # (Linux) cabal builds require pre-installed cabal-install and ghc
74 # (Linux) cabal builds require pre-installed cabal-install and ghc
35 # --------------------------------------------------------------------------
75 # --------------------------------------------------------------------------
37− - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22
77+ #- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.3
38− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
78+ # addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
40− - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24
80+ - env: BUILD=cabal CABALVER=1.24 GHCVER=8.0.2
41 addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
81 addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
43− - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0
83+ #- env: BUILD=cabal CABALVER=2.0 GHCVER=8.2.2
84+ # addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
86+ - env: BUILD=cabal CABALVER=head GHCVER=head
44− addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
87+ addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
46 # --------------------------------------------------------------------------
89 # --------------------------------------------------------------------------
47 # OS X builds
90 # OS X builds
48 # --------------------------------------------------------------------------
91 # --------------------------------------------------------------------------
50 # GHC 8.2.2/cabal build via stack
93 # GHC 8.2.2/cabal build via stack
51− - env: BUILD=cabal RESOLVER=lts-10.0
94+ #- env: BUILD=cabal RESOLVER=lts-10
54 # GHC 8.2.2/stack
97 # GHC 8.2.2/stack
55− - env: BUILD=stack RESOLVER=lts-10.0
98+ - env: BUILD=stack RESOLVER=lts-10
58 # --------------------------------------------------------------------------
101 # --------------------------------------------------------------------------
60 # --------------------------------------------------------------------------
103 # --------------------------------------------------------------------------
62− - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
105+ - env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
64 # --------------------------------------------------------------------------
107 # --------------------------------------------------------------------------
65 # Build and send coverage report to coveralls.io using hpc-coveralls
108 # Build and send coverage report to coveralls.io using hpc-coveralls
66 # --------------------------------------------------------------------------
109 # --------------------------------------------------------------------------
68 # Note COVERALLS (hpc-coveralls) works only with cabal build.
111 # Note COVERALLS (hpc-coveralls) works only with cabal build.
69− # For this to succeed you have to add your porject to coveralls.io first
112+ # For this to succeed you have to add your project to coveralls.io first
70− - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 COVERALLS_OPTIONS="--coverage-mode=StrictlyFullLines --exclude-dir=test test"
113+ - env: BUILD=cabal CABALVER=2.0 GHCVER=8.2.2 COVERALLS_OPTIONS="--coverage-mode=StrictlyFullLines --exclude-dir=test test"
71 addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
114 addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
73 # --------------------------------------------------------------------------
116 # --------------------------------------------------------------------------
@@ -76,12 +119,14 @@ matrix:
77 allow_failures:
120 allow_failures:
78 - env: BUILD=stack RESOLVER=nightly
121 - env: BUILD=stack RESOLVER=nightly
122+ - env: BUILD=cabal CABALVER=head GHCVER=head
79− - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
123+ - env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
81# ------------------------------------------------------------------------
125# ------------------------------------------------------------------------
82# Settings beyond this point are advanced and normally not tweaked
126# Settings beyond this point are advanced and normally not tweaked
83# ------------------------------------------------------------------------
127# ------------------------------------------------------------------------
85sudo: false
130sudo: false
87 directories:
132 directories:
@@ -89,12 +134,10 @@ cache:
89 - $HOME/.ghc
134 - $HOME/.ghc
90 - $HOME/.local
135 - $HOME/.local
91 - $HOME/.stack
136 - $HOME/.stack
95− # Where to find the packcheck.sh script
96− PACKCHECK_URL=https://raw.githubusercontent.com/harendra-kumar/packcheck/${PACKCHECK_COMMIT}/packcheck.sh
98 # When GHCVER or CABALVER env variables are specified, modify the path to
141 # When GHCVER or CABALVER env variables are specified, modify the path to
99 # find the binaries installed from hvr-ghc repo
142 # find the binaries installed from hvr-ghc repo
100 add_path() { eval "test -n \"\$$1\"" && eval "PATH=/opt/$2/\"\$$1\"/bin:$PATH"; true; }
143 add_path() { eval "test -n \"\$$1\"" && eval "PATH=/opt/$2/\"\$$1\"/bin:$PATH"; true; }
@@ -102,38 +145,19 @@ script:
102 # Emit the value of the var specified as arg only when the build is cabal
145 # Emit the value of the var specified as arg only when the build is cabal
103 cabal_env() { test "$BUILD" = cabal && echo $1; }
146 cabal_env() { test "$BUILD" = cabal && echo $1; }
148+ # If a custom stack-yaml is specified, replace the default with that
149+ if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
152+ # Get packcheck if needed
105 CURL=$(which curl)
153 CURL=$(which curl)
106− PATH=/bin:/usr/bin
154+ PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
155+ if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
156+ chmod +x $PACKCHECK_LOCAL_PATH
107 add_path GHCVER ghc
158 add_path GHCVER ghc
108 add_path CABALVER cabal
159 add_path CABALVER cabal
110− # If a custom stack-yaml is specified, replace the default with that
161+ # In addition to PACKCHECK envvars hpc-coveralls needs TRAVIS,
111− if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
162+ # TRAVIS_JOB_ID variables set by the travis CI environment.
112− if test ! -e "$PACKCHECK"; then $CURL -sL -o "$PACKCHECK" $PACKCHECK_URL; fi;
115− # We start with a clean environment (env -i) and specify all the
116− # environment variables explicitly. TRAVIS vars are needed by
121− TRAVIS_JOB_ID=$TRAVIS_JOB_ID
125− STACK_BUILD_OPTIONS="$STACK_BUILD_OPTIONS"
127− GHC_OPTIONS="$GHC_OPTIONS"
128− COVERALLS_OPTIONS="$COVERALLS_OPTIONS"
129− CABAL_REINIT_CONFIG=y
131− $(cabal_env CABALVER=$CABALVER)
132− $(cabal_env CABAL_CHECK_RELAX=y)
133− $(cabal_env CABAL_NO_SANDBOX=y)
134− $(cabal_env CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com)
135− HLINT_OPTIONS="$HLINT_OPTIONS"
136− bash -c "$PACKCHECK $BUILD"
163+ - bash -c "$PACKCHECK_LOCAL_PATH $BUILD"