From 32497f3a6fbfb3807f9c93f33eaadc125c3f1af1 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 9 Oct 2021 19:37:08 +0200 Subject: [PATCH 1/2] Add mkdocs to CI --- .gitlab-ci.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8b964e..c09882a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ stages: - - hlint + - checks - test - release @@ -585,7 +585,7 @@ release:windows: ######## hlint ######## hlint: - stage: hlint + stage: checks extends: - .debian script: @@ -596,3 +596,17 @@ hlint: paths: - report.html when: on_failure + +######## mkdocs ######## + +mkdocs: + stage: checks + extends: + - .debian + before_script: + - sudo apt-get update -y + - sudo apt-get install -y python3-pip + - pip3 install mkdocs + script: + - ~/.local/bin/mkdocs build + allow_failure: true From ab44e9d2ac440f228f17797a2ac5b5238b708c07 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 9 Oct 2021 19:46:29 +0200 Subject: [PATCH 2/2] Add shellcheck check --- .gitlab-ci.yml | 12 ++++++++++++ scripts/bootstrap/bootstrap-haskell | 13 +++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c09882a..c563074 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -610,3 +610,15 @@ mkdocs: script: - ~/.local/bin/mkdocs build allow_failure: true + +######## shellcheck ######## + +shellcheck: + image: "koalaman/shellcheck-alpine" + tags: + - x86_64-linux + stage: checks + script: + - shellcheck scripts/bootstrap/bootstrap-haskell + allow_failure: true + diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index 3eb07a7..7146720 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -70,6 +70,7 @@ warn() { else case "${plat}" in MSYS*|MINGW*) + # shellcheck disable=SC3037 echo -e "\\033[0;35m$1\\033[0m" ;; *) @@ -85,6 +86,7 @@ yellow() { else case "${plat}" in MSYS*|MINGW*) + # shellcheck disable=SC3037 echo -e "\\033[0;33m$1\\033[0m" ;; *) @@ -100,6 +102,7 @@ green() { else case "${plat}" in MSYS*|MINGW*) + # shellcheck disable=SC3037 echo -e "\\033[0;32m$1\\033[0m" ;; *) @@ -122,8 +125,10 @@ _eghcup() { args="-s ${BOOTSTRAP_HASKELL_YAML}" fi if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then + # shellcheck disable=SC2086 "${GHCUP_BIN}/ghcup" ${args} "$@" else + # shellcheck disable=SC2086 "${GHCUP_BIN}/ghcup" ${args} --verbose "$@" fi } @@ -389,7 +394,7 @@ adjust_bashrc() { echo "set -q GHCUP_INSTALL_BASE_PREFIX[1]; or set GHCUP_INSTALL_BASE_PREFIX \$HOME ; set -gx PATH \$HOME/.cabal/bin \$PATH $GHCUP_BIN # ghcup-env" >> "${GHCUP_PROFILE_FILE}" ;; esac - break ;; + ;; bash) sed -i -e '/# ghcup-env$/ s/^#*/#/' "${GHCUP_PROFILE_FILE}" echo "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "${GHCUP_PROFILE_FILE}" @@ -407,12 +412,12 @@ adjust_bashrc() { fi ;; esac - break ;; + ;; zsh) sed -i -e '/# ghcup-env$/ s/^#*/#/' "${GHCUP_PROFILE_FILE}" echo "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "${GHCUP_PROFILE_FILE}" - break ;; + ;; esac echo echo "===============================================================================" @@ -644,7 +649,7 @@ else fi echo -echo "$(if [ -n "${BOOTSTRAP_HASKELL_YAML}" ] ; then ghcup -s "${BOOTSTRAP_HASKELL_YAML}" tool-requirements ; else ghcup tool-requirements ; fi)" +if [ -n "${BOOTSTRAP_HASKELL_YAML}" ] ; then (>&2 ghcup -s "${BOOTSTRAP_HASKELL_YAML}" tool-requirements) ; else (>&2 ghcup tool-requirements) ; fi echo if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then