2019-01-25 16:00:28 +01:00
|
|
|
version: "2.1"
|
|
|
|
|
|
|
|
env: &env
|
|
|
|
environment:
|
|
|
|
LC_ALL: "C.UTF-8"
|
|
|
|
docker:
|
2019-08-16 20:35:32 +02:00
|
|
|
- image: fpco/stack-build:lts-13
|
2019-01-25 16:00:28 +01:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Common utility stuff, not to be modified usually
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
preinstall: &preinstall
|
|
|
|
run: |
|
2019-03-27 05:35:24 +01:00
|
|
|
echo 'export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH' >> $BASH_ENV
|
2019-01-25 16:00:28 +01:00
|
|
|
source $BASH_ENV
|
|
|
|
apt-get update
|
|
|
|
|
|
|
|
restore: &restore
|
|
|
|
# Needs to happen after installing ca-certificates
|
|
|
|
restore_cache:
|
|
|
|
key: v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
|
|
|
|
|
|
|
|
save: &save
|
|
|
|
save_cache:
|
|
|
|
key: v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
|
|
|
|
paths:
|
|
|
|
- ~/.cabal
|
|
|
|
- ~/.ghc
|
|
|
|
- ~/.local
|
|
|
|
- ~/.stack
|
|
|
|
|
|
|
|
commands:
|
|
|
|
cabal_build:
|
|
|
|
parameters:
|
|
|
|
ghcversion:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *preinstall
|
|
|
|
- *restore
|
2019-03-26 19:39:41 +01:00
|
|
|
- run:
|
|
|
|
name: install cabal
|
|
|
|
command: apt-get install -y cabal-install-2.4
|
2019-01-25 16:00:28 +01:00
|
|
|
- run:
|
|
|
|
name: install ghc
|
2019-03-26 21:56:49 +01:00
|
|
|
command: |
|
|
|
|
apt-get install -y ghc-<< parameters.ghcversion >>
|
|
|
|
- run:
|
2019-03-27 15:30:37 +01:00
|
|
|
name: build and test project
|
2019-03-26 21:56:49 +01:00
|
|
|
command: |
|
|
|
|
set -e
|
|
|
|
cabal v2-update
|
|
|
|
TMPDIR=`mktemp -d -t circleci.XXXXXXX`
|
|
|
|
cabal v2-sdist --output-dir=${TMPDIR}
|
|
|
|
cd ${TMPDIR}
|
|
|
|
tar xvzf *.tar.gz
|
|
|
|
cd *
|
2019-03-27 19:26:41 +01:00
|
|
|
cabal v2-build -w ghc-<< parameters.ghcversion >> -j2 --disable-optimization --dependencies-only --enable-tests --enable-benchmarks
|
|
|
|
cabal v2-build -w ghc-<< parameters.ghcversion >> -j2 --disable-optimization --enable-tests --enable-benchmarks 2>build.log
|
2019-03-26 21:56:49 +01:00
|
|
|
cat build.log
|
|
|
|
# fail if we had warnings in local build
|
|
|
|
# this is to work around the fact that cabal v2 doesn't allow
|
|
|
|
# us to use -Werror for just local build:
|
|
|
|
# https://github.com/haskell/cabal/issues/4247
|
2019-03-27 19:24:50 +01:00
|
|
|
! grep -q "[Ww]arning:" build.log
|
2019-03-27 19:26:41 +01:00
|
|
|
cabal v2-test -w ghc-<< parameters.ghcversion >> -j2 --disable-optimization --enable-tests
|
2019-03-27 17:02:40 +01:00
|
|
|
cabal v2-haddock -w ghc-<< parameters.ghcversion >>
|
2019-03-26 21:56:49 +01:00
|
|
|
cabal check
|
2019-01-25 16:00:28 +01:00
|
|
|
- *save
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Build matrix
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
jobs:
|
2019-08-26 22:06:04 +02:00
|
|
|
cabal-ghc-8_8_1:
|
|
|
|
<<: *env
|
|
|
|
steps:
|
|
|
|
- cabal_build:
|
|
|
|
ghcversion: 8.8.1
|
|
|
|
|
2019-05-01 21:16:17 +02:00
|
|
|
cabal-ghc-8_6_5:
|
2019-01-25 16:00:28 +01:00
|
|
|
<<: *env
|
|
|
|
steps:
|
|
|
|
- cabal_build:
|
2019-05-01 21:16:17 +02:00
|
|
|
ghcversion: 8.6.5
|
2019-01-25 16:00:28 +01:00
|
|
|
|
|
|
|
cabal-ghc-8_4_4:
|
|
|
|
<<: *env
|
|
|
|
steps:
|
|
|
|
- cabal_build:
|
|
|
|
ghcversion: 8.4.4
|
|
|
|
|
|
|
|
cabal-ghc-8_2_2:
|
|
|
|
<<: *env
|
|
|
|
steps:
|
|
|
|
- cabal_build:
|
|
|
|
ghcversion: 8.2.2
|
|
|
|
|
|
|
|
cabal-ghc-8_0_2:
|
|
|
|
<<: *env
|
|
|
|
steps:
|
|
|
|
- cabal_build:
|
|
|
|
ghcversion: 8.0.2
|
|
|
|
|
|
|
|
stack-ghc-8_6:
|
|
|
|
<<: *env
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *preinstall
|
|
|
|
- *restore
|
|
|
|
- run: |
|
|
|
|
set -e
|
2019-05-01 21:16:17 +02:00
|
|
|
apt-get install -y ghc-8.6.5
|
2019-01-25 16:00:28 +01:00
|
|
|
stack update
|
2019-03-27 17:22:35 +01:00
|
|
|
stack test --system-ghc --fast --ghc-options="-Werror" .
|
2019-01-25 16:00:28 +01:00
|
|
|
- *save
|
|
|
|
|
|
|
|
workflows:
|
2019-01-25 16:15:16 +01:00
|
|
|
version: "2.1"
|
2019-01-25 16:00:28 +01:00
|
|
|
build:
|
|
|
|
jobs:
|
2019-05-01 21:16:17 +02:00
|
|
|
- cabal-ghc-8_6_5
|
2019-01-25 16:00:28 +01:00
|
|
|
- cabal-ghc-8_4_4
|
|
|
|
- cabal-ghc-8_2_2
|
|
|
|
- cabal-ghc-8_0_2
|
|
|
|
- stack-ghc-8_6
|
2019-08-27 03:12:59 +02:00
|
|
|
# - cabal-ghc-8_8_1
|
|
|
|
|