git.iko.soy/typeable/pandoc
on master help sign in
.travis.yml: simplify GHC and cabal package handling

This reduces duplicate information on GHC and cabal versions when defining build environments.

commitebb35e613cf21aaf13996bc0e35791a0e90aa64b authorAlbert Krewinkel <albert@zeitkraut.de> dateSat 27 Oct 2018, 20:35 (8 years ago) parentdc4b5cb
1 file changed+11−6
.travis.yml+11−6
.travis.yml+11−6
@@ -18,6 +18,13 @@ env:
1818 global:
1919 - GHC_OPTIONS="-O0 -Werror"
2020
21+addons:
22+ apt:
23+ packages:
24+ - happy-1.19.5
25+ sources:
26+ - hvr-ghc
27+
2128# The different configurations we want to test. We have BUILD=cabal which uses
2229# cabal-install, and BUILD=stack which uses Stack. More documentation on each
2330# of those below.
@@ -44,7 +51,6 @@ matrix:
4451 CABALARGS=""
4552 TESTPATTERN="! /Round trip/"
4653 compiler: ": #GHC 7.10.3"
47− addons: {apt: {packages: [cabal-install-2.0,ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}}
4854
4955 # don't build benchmarks for ghc 8.0.2, because build takes too long...
5056 - env: >-
@@ -55,7 +61,6 @@ matrix:
5561 CABALARGS=""
5662 TESTPATTERN="! /Round trip/"
5763 compiler: ": #GHC 8.0.2"
58− addons: {apt: {packages: [cabal-install-2.0,ghc-8.0.2,happy-1.19.5], sources: [hvr-ghc]}}
5964
6065 - env: >-
6166 BUILD=cabal
@@ -65,7 +70,6 @@ matrix:
6570 CABALARGS="--enable-benchmarks"
6671 TESTPATTERN="! /Round trip/"
6772 compiler: ": #GHC 8.2.2"
68− addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5], sources: [hvr-ghc]}}
6973
7074 - env: >-
7175 BUILD=cabal
@@ -75,7 +79,6 @@ matrix:
7579 CABALARGS="--enable-benchmarks"
7680 TESTPATTERN="! /Round trip/"
7781 compiler: ": #GHC 8.4.3"
78− addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.3,happy-1.19.5], sources: [hvr-ghc]}}
7982
8083 # - env: >-
8184 # BUILD=cabal
@@ -101,17 +104,17 @@ matrix:
101104 - env: >-
102105 BUILD=stack
103106 ARGS="--resolver lts-12"
107+ GHCVER=8.4.3
104108 TESTPATTERN="! /Round trip/"
105109 compiler: ": #stack 8.4.3"
106− addons: {apt: {packages: [ghc-8.4.3], sources: [hvr-ghc]}}
107110
108111 # Nightly builds are allowed to fail
109112 - env: >-
110113 BUILD=stack
111114 ARGS="--resolver nightly"
115+ GHCVER=8.4.3
112116 TESTPATTERN="."
113117 compiler: ": #stack nightly"
114− addons: {apt: {packages: [ghc-8.4.3], sources: [hvr-ghc]}}
115118
116119 # - env: BUILD=stack ARGS="--resolver lts-8"
117120 # compiler: ": #stack 8.0.2 osx"
@@ -126,6 +129,7 @@ matrix:
126129 - env: >-
127130 BUILD=stack
128131 ARGS="--resolver nightly"
132+ GHCVER=8.4.3
129133 TESTPATTERN="."
130134
131135 fast_finish: true
@@ -133,6 +137,7 @@ matrix:
133137before_install:
134138# Using compiler above sets CC to an invalid value, so unset it
135139- unset CC
140+- sudo apt-get install ${GHCVER:+ghc-$GHCVER} ${CABALVER:+cabal-install-$CABALVER}
136141- export PATH=/opt/happy/1.19.5/bin/:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:/opt/cabal/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH
137142# Download and unpack the stack executable
138143- |