Enable gitlab travis
This commit is contained in:
parent
f4242b10e7
commit
2b6cb5f1a8
78
.gitlab-ci.yml
Normal file
78
.gitlab-ci.yml
Normal file
@ -0,0 +1,78 @@
|
||||
variables:
|
||||
GIT_SSL_NO_VERIFY: "1"
|
||||
|
||||
# Commit of ghc/ci-images repository from which to pull Docker images
|
||||
DOCKER_REV: cefaee3c742af193e0f7783f87edb0d35374515c
|
||||
|
||||
############################################################
|
||||
# CI Step
|
||||
############################################################
|
||||
|
||||
.debian:
|
||||
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
|
||||
tags:
|
||||
- x86_64-linux
|
||||
|
||||
.darwin:
|
||||
tags:
|
||||
- x86_64-darwin
|
||||
|
||||
.test_ghcup_version:
|
||||
script:
|
||||
- ./.gitlab/script/ghcup_version.sh
|
||||
variables:
|
||||
JSON_VERSION: "0.0.1"
|
||||
|
||||
.test_ghcup_version:linux:
|
||||
extends:
|
||||
- .test_ghcup_version
|
||||
- .debian
|
||||
before_script:
|
||||
- ./.gitlab/before_script/linux/install_deps.sh
|
||||
variables:
|
||||
OS: "LINUX"
|
||||
|
||||
.test_ghcup_version:darwin:
|
||||
extends:
|
||||
- .test_ghcup_version
|
||||
- .darwin
|
||||
before_script:
|
||||
- ./.gitlab/before_script/darwin/install_deps.sh
|
||||
variables:
|
||||
OS: "DARWIN"
|
||||
after_script:
|
||||
- BUILD_DIR=$CI_PROJECT_DIR
|
||||
- echo "Cleaning $BUILD_DIR"
|
||||
- cd $HOME
|
||||
- rm -Rf "$BUILD_DIR"/*
|
||||
- exit 0
|
||||
|
||||
|
||||
|
||||
######## linux ########
|
||||
|
||||
test:linux:recommended:
|
||||
extends: .test_ghcup_version:linux
|
||||
variables:
|
||||
GHC_VERSION: "recommended"
|
||||
|
||||
test:linux:latest:
|
||||
extends: .test_ghcup_version:linux
|
||||
variables:
|
||||
GHC_VERSION: "latest"
|
||||
allow_failure: true
|
||||
|
||||
|
||||
######## darwin ########
|
||||
|
||||
test:mac:recommended:
|
||||
extends: .test_ghcup_version:darwin
|
||||
variables:
|
||||
GHC_VERSION: "recommended"
|
||||
|
||||
test:mac:latest:
|
||||
extends: .test_ghcup_version:darwin
|
||||
variables:
|
||||
GHC_VERSION: "latest"
|
||||
allow_failure: true
|
||||
|
14
.gitlab/before_script/darwin/install_deps.sh
Executable file
14
.gitlab/before_script/darwin/install_deps.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||
|
||||
curl -sSfL https://gitlab.haskell.org/haskell/ghcup/-/raw/master/ghcup > ./ghcup-legacy
|
||||
chmod +x ghcup-legacy
|
||||
|
||||
./ghcup-legacy install ${GHC_VERSION}
|
||||
./ghcup-legacy set ${GHC_VERSION}
|
||||
./ghcup-legacy install-cabal
|
||||
|
||||
exit 0
|
16
.gitlab/before_script/linux/install_deps.sh
Executable file
16
.gitlab/before_script/linux/install_deps.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||
|
||||
curl -sSfL https://gitlab.haskell.org/haskell/ghcup/-/raw/master/ghcup > ./ghcup-legacy
|
||||
chmod +x ghcup-legacy
|
||||
|
||||
./ghcup-legacy install ${GHC_VERSION}
|
||||
./ghcup-legacy set ${GHC_VERSION}
|
||||
./ghcup-legacy install-cabal
|
||||
|
3
.gitlab/ghcup_env
Normal file
3
.gitlab/ghcup_env
Normal file
@ -0,0 +1,3 @@
|
||||
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
||||
export PATH="$CI_PROJECT_DIR/.ghcup/bin:$CI_PROJECT_DIR/.local/bin:$PATH"
|
||||
|
58
.gitlab/script/ghcup_version.sh
Executable file
58
.gitlab/script/ghcup_version.sh
Executable file
@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup_env"
|
||||
|
||||
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
||||
|
||||
ecabal() {
|
||||
cabal --store-dir="$(pwd)"/.store "$@"
|
||||
}
|
||||
|
||||
|
||||
# build
|
||||
ecabal update
|
||||
|
||||
if [ "${OS}" = "DARWIN" ] ; then
|
||||
ecabal build -fcurl
|
||||
else
|
||||
ecabal build
|
||||
fi
|
||||
|
||||
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup')" .
|
||||
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup-gen')" .
|
||||
|
||||
|
||||
# testing
|
||||
|
||||
cp ./ghcup "$CI_PROJECT_DIR"/.local/bin/ghcup
|
||||
cp ./ghcup-gen "$CI_PROJECT_DIR"/.local/bin/ghcup-gen
|
||||
rm -rf "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
|
||||
|
||||
ghcup-gen check -f ghcup-${JSON_VERSION}.json
|
||||
|
||||
ghcup numeric-version
|
||||
|
||||
ghcup -v -c install ${GHC_VERSION}
|
||||
ghcup -v -c set ${GHC_VERSION}
|
||||
ghcup -v -c install-cabal
|
||||
|
||||
cabal --version
|
||||
|
||||
ghcup -v -c debug-info
|
||||
|
||||
ghcup -v -c list
|
||||
ghcup -v -c list -t ghc
|
||||
ghcup -v -c list -t cabal
|
||||
|
||||
ghc --version
|
||||
ghci --version
|
||||
ghc-$(ghc --numeric-version) --version
|
||||
ghci-$(ghc --numeric-version) --version
|
||||
|
||||
ghcup -v upgrade
|
||||
ghcup -v upgrade -f
|
||||
|
||||
ghcup -v rm $(ghc --numeric-version)
|
||||
|
Loading…
Reference in New Issue
Block a user