Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'github-ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Jun 13, 2019
2 parents bcdff68 + b45916a commit 62d9606
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/sh

edo()
{
printf "\\033[0;34m%s\\033[0m\\n" "$*" 1>&2
"$@" || exit 2
}

GHCUP_META_DOWNLOAD_URL="file://$(pwd)/.download-urls"
export GHCUP_META_DOWNLOAD_URL
GHCUP_META_VERSION_URL="file://$(pwd)/.available-versions"
export GHCUP_META_VERSION_URL

# dependencies
edo sudo apt-get update -y
edo sudo apt-get install -y libnuma-dev

# install GHCs
edo ./ghcup -v install 8.2.2
edo ./ghcup -v install 8.4.3
edo ./ghcup -v -c install 8.6.1

# set GHC
edo ./ghcup -v set 8.6.1
edo ./ghcup -v set 8.4.3

# rm GHC
edo ./ghcup -v rm -f 8.6.1
edo ./ghcup -v rm -f 8.4.3

# reinstall from cached tarball
edo ./ghcup -v -c install 8.6.1
edo ./ghcup -v rm -f 8.6.1

# set GHC
edo ./ghcup -v set 8.2.2
edo ./ghcup -v rm -f 8.2.2

# install default GHC
edo ./ghcup -v install
edo ./ghcup -v set

# install latest GHC
edo ./ghcup -v install latest

export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$PATH"
edo mkdir -p "$HOME"/.local/bin

edo cp ./ghcup "$HOME"/.local/bin/ghcup

# TODO: exceeds maximum time limit of travis
# compile GHC from source
#./ghcup -v compile 8.4.3 ghc-8.2.2

# install cabal-install
edo ghcup -v install-cabal

edo cabal --version

# install shellcheck
edo wget https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz
edo tar -xJf shellcheck-latest.linux.x86_64.tar.xz
edo mv shellcheck-latest/shellcheck "$HOME"/.local/bin/shellcheck

# check our script for errors
edo shellcheck ghcup

edo ghcup -v debug-info

edo ghcup -v list
edo ghcup -v list -t ghc
edo ghcup -v list -t cabal-install

edo ghc --version

# self update destructively
edo ghcup -v upgrade
17 changes: 17 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variables:
GIT_SSL_NO_VERIFY: "1"

# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: cefaee3c742af193e0f7783f87edb0d35374515c

############################################################
# CI Step
############################################################

test:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
script:
- ./.github-ci.sh
dependencies: []
tags:
- x86_64-linux

0 comments on commit 62d9606

Please sign in to comment.