on master help sign in
Merge pull request #3941 from commercialhaskell/gitlab-too

Add a Gitlab CI configuration

commit43467ab858182824738c046dbec6b98ade45cba1 authorMichael Snoyman <michael@snoyman.com> dateFri 31 Aug 2018, 08:49 (8 years ago) parenta80b79a70b3449
3 files changed+42−22
.gitlab-ci.yml+15 .travis.yml+2−22 etc/ci-script.sh+25
.gitlab-ci.ymlnew file+15
@@ -0,0 +1,15 @@
1+image: fpco/stack-build:lts-12.8
2+
3+cache:
4+ paths:
5+ - $HOME/.stack
6+ - $HOME/.stackage/curator/cache
7+
8+stages:
9+ - build
10+
11+build:
12+ stage: build
13+ script:
14+ # Edit etc/ci-script.sh to change GHC version
15+ - ./etc/ci-script.sh
.travis.yml+2−22
@@ -10,29 +10,9 @@ addons:
1010 packages:
1111 - libgmp-dev
1212
13−env:
14−- GHCVER=8.4.3
15−
16−install:
17− # Download and unpack the stack executable
18− - mkdir -p ~/.local/bin
19− - export PATH=$HOME/.local/bin:$PATH
20− - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
21−
22− # Get stackage-curator
23− - wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
24− - bunzip2 stackage-curator.bz2
25− - chmod +x stackage-curator
26− - mv stackage-curator ~/.local/bin
27−
28− # Install GHC and cabal-install
29− - stack setup $GHCVER
30−
31− # Update the index
32− - travis_retry stack update
33−
13+# Edit etc/ci-script.sh to change GHC version
3414script:
35− - stack --resolver ghc-$GHCVER exec stackage-curator check
15+- ./etc/ci-script.sh
3616
3717cache:
3818 directories:
etc/ci-script.shnew file+25
@@ -0,0 +1,25 @@
1+#!/usr/bin/env bash
2+
3+set -euxo pipefail
4+
5+export GHCVER=8.4.3
6+
7+# Download and unpack the stack executable
8+mkdir -p ~/.local/bin
9+export PATH=$HOME/.local/bin:$PATH
10+curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
11+
12+# Get stackage-curator
13+wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
14+bunzip2 stackage-curator.bz2
15+chmod +x stackage-curator
16+mv stackage-curator ~/.local/bin
17+
18+# Install GHC
19+stack setup $GHCVER
20+
21+# Update the index
22+stack update
23+
24+# Check
25+exec stack --resolver ghc-$GHCVER exec stackage-curator check