From 931576b903bad74d8eef259c7e9feb22e732d5c6 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 30 May 2019 12:31:05 +0800 Subject: [PATCH 1/5] First attempt of github ci --- .github-ci.sh | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 11 ++++++++ 2 files changed, 82 insertions(+) create mode 100644 .github-ci.sh create mode 100644 .gitlab-ci.yml diff --git a/.github-ci.sh b/.github-ci.sh new file mode 100644 index 0000000..37ea58f --- /dev/null +++ b/.github-ci.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +edo() +{ + printf "\\033[0;34m%s\\033[0m\\n" "$*" 1>&2 + "$@" || exit 2 +} + +edo rm .available-versions +edo rm .download-urls + +# 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 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..cbc9f9b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,11 @@ +before_script: + - add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" -y + - apt-get update -qq + - apt-get install -y -qq autoconf automake g++ gcc git libgmp-dev libllvm5.0 libtinfo-dev libtool llvm-5.0 llvm-5.0-dev make ncurses-dev python3 realpath xz-utils + + +# TODO: also run checkbashisms.pl (currently two instances of non-compliance) +test: + script: + - ./.github-ci.sh + From 2b04c0a24258e7456b0ac2348faf631328d03c02 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 12 Jun 2019 15:55:30 +0100 Subject: [PATCH 2/5] Fix CI config --- .gitlab-ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbc9f9b..628c7d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,17 @@ -before_script: - - add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" -y - - apt-get update -qq - - apt-get install -y -qq autoconf automake g++ gcc git libgmp-dev libllvm5.0 libtinfo-dev libtool llvm-5.0 llvm-5.0-dev make ncurses-dev python3 realpath xz-utils +variables: + GIT_SSL_NO_VERIFY: "1" + # Commit of ghc/ci-images repository from which to pull Docker images + DOCKER_REV: cefaee3c742af193e0f7783f87edb0d35374515c + +############################################################ +# CI Step +############################################################ -# TODO: also run checkbashisms.pl (currently two instances of non-compliance) test: + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" script: - ./.github-ci.sh - + dependencies: [] + tags: + - x86_64-linux From 9c7e02af238db2ce11a11d2283993b50c6d40125 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 12 Jun 2019 17:46:55 +0100 Subject: [PATCH 3/5] Execute .github-ci.sh --- .github-ci.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github-ci.sh diff --git a/.github-ci.sh b/.github-ci.sh old mode 100644 new mode 100755 From a6aace47346896bc05ba5adbd06a11c834f53b13 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 13 Jun 2019 11:01:48 +0800 Subject: [PATCH 4/5] Install missing libnuma --- .github-ci.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github-ci.sh b/.github-ci.sh index 37ea58f..34120f6 100755 --- a/.github-ci.sh +++ b/.github-ci.sh @@ -6,6 +6,10 @@ edo() "$@" || exit 2 } +# dependencies +edo sudo apt-get update -y +edo sudo apt-get install -y libnuma-dev + edo rm .available-versions edo rm .download-urls From b45916a6c8facdb66f207584ae8436baeccf10da Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 13 Jun 2019 11:08:44 +0800 Subject: [PATCH 5/5] Use local .available-versions and .download-urls --- .github-ci.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github-ci.sh b/.github-ci.sh index 34120f6..db96820 100755 --- a/.github-ci.sh +++ b/.github-ci.sh @@ -6,13 +6,15 @@ edo() "$@" || 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 -edo rm .available-versions -edo rm .download-urls - # install GHCs edo ./ghcup -v install 8.2.2 edo ./ghcup -v install 8.4.3