From 70b3449166721fd62e7ad1b55f6199e41e455175 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 30 Aug 2018 16:48:30 +0300 Subject: [PATCH] Add a Gitlab CI configuration --- .gitlab-ci.yml | 15 +++++++++++++++ .travis.yml | 24 ++---------------------- etc/ci-script.sh | 25 +++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100755 etc/ci-script.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..9a45da61 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,15 @@ +image: fpco/stack-build:lts-12.8 + +cache: + paths: + - $HOME/.stack + - $HOME/.stackage/curator/cache + +stages: + - build + +build: + stage: build + script: + # Edit etc/ci-script.sh to change GHC version + - ./etc/ci-script.sh diff --git a/.travis.yml b/.travis.yml index 70756a43..a1555153 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,29 +10,9 @@ addons: packages: - libgmp-dev -env: -- GHCVER=8.4.3 - -install: - # Download and unpack the stack executable - - mkdir -p ~/.local/bin - - export PATH=$HOME/.local/bin:$PATH - - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - - # Get stackage-curator - - wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2 - - bunzip2 stackage-curator.bz2 - - chmod +x stackage-curator - - mv stackage-curator ~/.local/bin - - # Install GHC and cabal-install - - stack setup $GHCVER - - # Update the index - - travis_retry stack update - +# Edit etc/ci-script.sh to change GHC version script: - - stack --resolver ghc-$GHCVER exec stackage-curator check +- ./etc/ci-script.sh cache: directories: diff --git a/etc/ci-script.sh b/etc/ci-script.sh new file mode 100755 index 00000000..12d1853c --- /dev/null +++ b/etc/ci-script.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +export GHCVER=8.4.3 + +# Download and unpack the stack executable +mkdir -p ~/.local/bin +export PATH=$HOME/.local/bin:$PATH +curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' + +# Get stackage-curator +wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2 +bunzip2 stackage-curator.bz2 +chmod +x stackage-curator +mv stackage-curator ~/.local/bin + +# Install GHC +stack setup $GHCVER + +# Update the index +stack update + +# Check +exec stack --resolver ghc-$GHCVER exec stackage-curator check