Merge pull request #3941 from commercialhaskell/gitlab-too

Add a Gitlab CI configuration
This commit is contained in:
Michael Snoyman 2018-08-31 08:49:53 +03:00 committed by GitHub
commit 43467ab858
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 22 deletions

15
.gitlab-ci.yml Normal file
View File

@ -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

View File

@ -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:

25
etc/ci-script.sh Executable file
View File

@ -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