@@ -1,13 +1,49 @@
1−notifications:
2− email: false
3−
1+# See https://github.com/harendra-kumar/packcheck for all options and their
2+# explanation.
43env:
54 global:
6− - GHC_OPTIONS="-O0 -Werror"
7− - PACKCHECK="./packcheck.sh"
8− # The commit id of packcheck.sh to use from harendra-kumar/packcheck on github
9− - PACKCHECK_COMMIT="c028c2425a372487e74157569d0a6cd4d745575d"
5+ # ------------------------------------------------------------------------
6+ # Global options used for all CI tests
7+ # ------------------------------------------------------------------------
8+ - GHC_OPTIONS="-Werror"
9+ # ------------------------------------------------------------------------
10+ # Options for builds that need stack
11+ # ------------------------------------------------------------------------
12+ #- STACKVER="1.6.5"
13+ - STACK_UPGRADE="y"
14+ # ------------------------------------------------------------------------
15+ # Other options: Normally you would not need to customize these
16+ # ------------------------------------------------------------------------
17+ - CABAL_REINIT_CONFIG=y
18+ - CABAL_CHECK_RELAX=y
19+ - CABAL_NO_SANDBOX=y
20+ - CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com
21+ - TEST_INSTALL=y
22+ - PATH=/bin:/usr/bin
23+ - LC_ALL=C.UTF-8
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"
36+
37+notifications:
38+ email: false
1039
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.
44+#
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.
1147matrix:
1248 include:
1349
@@ -15,59 +51,66 @@ matrix:
1551 # (Linux) stack builds
1652 # --------------------------------------------------------------------------
1753
18− # GHC 7.10.3
19− - env: BUILD=stack RESOLVER=lts-6.35 STACK_YAML=stack-7.10.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
20− addons: {apt: {packages: [libsdl1.2-dev]}}
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"
55+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,libsdl1.2-dev], sources: [hvr-ghc]}}
2156
22− # GHC 8.0.2
23− - env: BUILD=stack RESOLVER=lts-9.20 STACK_YAML=stack-8.0.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
24− addons: {apt: {packages: [libsdl1.2-dev]}}
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"
58+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,libsdl1.2-dev], sources: [hvr-ghc]}}
2559
26− # GHC 8.2.2
27− - env: BUILD=stack RESOLVER=lts-10.0 STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
28− addons: {apt: {packages: [libsdl1.2-dev]}}
60+ - env: BUILD=stack CABALVER=2.0 GHCVER=8.2.2 RESOLVER=lts-10 STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
61+ addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,libsdl1.2-dev], sources: [hvr-ghc]}}
2962
3063 # Nightly
3164 - env: BUILD=stack RESOLVER=nightly
3265
66+ # Using a custom stack-yaml config file.
67+ #- env: BUILD=stack STACK_YAML=.ci/stack-8.0.yaml
68+
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"
72+
3373 # --------------------------------------------------------------------------
3474 # (Linux) cabal builds require pre-installed cabal-install and ghc
3575 # --------------------------------------------------------------------------
3676
37− - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22
38− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
77+ #- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.3
78+ # addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
3979
40− - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24
80+ - env: BUILD=cabal CABALVER=1.24 GHCVER=8.0.2
4181 addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
4282
43− - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0
44− addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
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]}}
85+
86+ - env: BUILD=cabal CABALVER=head GHCVER=head
87+ addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
4588
4689 # --------------------------------------------------------------------------
4790 # OS X builds
4891 # --------------------------------------------------------------------------
4992
5093 # GHC 8.2.2/cabal build via stack
51− - env: BUILD=cabal RESOLVER=lts-10.0
52− os: osx
94+ #- env: BUILD=cabal RESOLVER=lts-10
95+ # os: osx
5396
5497 # GHC 8.2.2/stack
55− - env: BUILD=stack RESOLVER=lts-10.0
98+ - env: BUILD=stack RESOLVER=lts-10
5699 os: osx
57100
58101 # --------------------------------------------------------------------------
59102 # Lint
60103 # --------------------------------------------------------------------------
61104
62− - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
105+ - env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
63106
64107 # --------------------------------------------------------------------------
65108 # Build and send coverage report to coveralls.io using hpc-coveralls
66109 # --------------------------------------------------------------------------
67110
68111 # Note COVERALLS (hpc-coveralls) works only with cabal build.
69− # For this to succeed you have to add your porject to coveralls.io first
70− - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 COVERALLS_OPTIONS="--coverage-mode=StrictlyFullLines --exclude-dir=test test"
112+ # For this to succeed you have to add your project to coveralls.io first
113+ - env: BUILD=cabal CABALVER=2.0 GHCVER=8.2.2 COVERALLS_OPTIONS="--coverage-mode=StrictlyFullLines --exclude-dir=test test"
71114 addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
72115
73116 # --------------------------------------------------------------------------
@@ -76,12 +119,14 @@ matrix:
76119
77120 allow_failures:
78121 - env: BUILD=stack RESOLVER=nightly
79− - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
122+ - env: BUILD=cabal CABALVER=head GHCVER=head
123+ - env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
80124
81125# ------------------------------------------------------------------------
82126# Settings beyond this point are advanced and normally not tweaked
83127# ------------------------------------------------------------------------
84128
129+language: generic
85130sudo: false
86131cache:
87132 directories:
@@ -89,12 +134,10 @@ cache:
89134 - $HOME/.ghc
90135 - $HOME/.local
91136 - $HOME/.stack
137+install: true
92138
93139script:
94140 - |
95− # Where to find the packcheck.sh script
96− PACKCHECK_URL=https://raw.githubusercontent.com/harendra-kumar/packcheck/${PACKCHECK_COMMIT}/packcheck.sh
97−
98141 # When GHCVER or CABALVER env variables are specified, modify the path to
99142 # find the binaries installed from hvr-ghc repo
100143 add_path() { eval "test -n \"\$$1\"" && eval "PATH=/opt/$2/\"\$$1\"/bin:$PATH"; true; }
@@ -102,38 +145,19 @@ script:
102145 # Emit the value of the var specified as arg only when the build is cabal
103146 cabal_env() { test "$BUILD" = cabal && echo $1; }
104147
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
150+ unset STACK_YAML
151+
152+ # Get packcheck if needed
105153 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
157+
107158 add_path GHCVER ghc
108159 add_path CABALVER cabal
109160
110− # If a custom stack-yaml is specified, replace the default with that
111− if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
112− if test ! -e "$PACKCHECK"; then $CURL -sL -o "$PACKCHECK" $PACKCHECK_URL; fi;
113− chmod +x $PACKCHECK
114−
115− # We start with a clean environment (env -i) and specify all the
116− # environment variables explicitly. TRAVIS vars are needed by
117− # hpc-coveralls.
118− - env -i
119− LC_ALL=C.UTF-8
120− TRAVIS=$TRAVIS
121− TRAVIS_JOB_ID=$TRAVIS_JOB_ID
122− PATH="$PATH"
123− RESOLVER=$RESOLVER
124− STACK_UPGRADE=y
125− STACK_BUILD_OPTIONS="$STACK_BUILD_OPTIONS"
126− GHCVER=$GHCVER
127− GHC_OPTIONS="$GHC_OPTIONS"
128− COVERALLS_OPTIONS="$COVERALLS_OPTIONS"
129− CABAL_REINIT_CONFIG=y
130− TEST_INSTALL=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"
137−
138−install: true
139−language: c
161+ # In addition to PACKCHECK envvars hpc-coveralls needs TRAVIS,
162+ # TRAVIS_JOB_ID variables set by the travis CI environment.
163+ - bash -c "$PACKCHECK_LOCAL_PATH $BUILD"