Skip to content

Commit

Permalink
Adjust CI to our needs
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Mar 1, 2024
1 parent 683d78d commit 784d9af
Show file tree
Hide file tree
Showing 5 changed files with 412 additions and 132 deletions.
48 changes: 25 additions & 23 deletions .github/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ install_ghcup() {
else
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_MINIMAL=1 sh
source "$(dirname "${GHCUP_BIN}")/env"
# make sure we use the vanilla channel for installing binaries
# see https://github.com/haskell/ghcup-metadata/pull/166#issuecomment-1893075575
ghcup config set url-source https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml
ghcup install cabal --set "${BOOTSTRAP_HASKELL_CABAL_VERSION}"
fi
}
Expand Down Expand Up @@ -213,26 +210,31 @@ mktempdir() {
setup_locale() {
# BSD grep terminates early with -q, consequently locale -a will get a
# SIGPIPE and the pipeline will fail with pipefail.
shopt -o -u pipefail
if locale -a | grep -q C.UTF-8; then
# Debian
export LANG=C.UTF-8
elif locale -a | grep -q C.utf8; then
# Fedora calls it this
export LANG=C.utf8
elif locale -a | grep -q en_US.UTF-8; then
# Centos doesn't have C.UTF-8
export LANG=en_US.UTF-8
elif locale -a | grep -q en_US.utf8; then
# Centos doesn't have C.UTF-8
export LANG=en_US.utf8
if command -v locale >/dev/null 2>&1 ; then
shopt -o -u pipefail
if locale -a | grep -q C.UTF-8; then
# Debian
export LANG=C.UTF-8
elif locale -a | grep -q C.utf8; then
# Fedora calls it this
export LANG=C.utf8
elif locale -a | grep -q en_US.UTF-8; then
# Centos doesn't have C.UTF-8
export LANG=en_US.UTF-8
elif locale -a | grep -q en_US.utf8; then
# Centos doesn't have C.UTF-8
export LANG=en_US.utf8
else
error "Failed to find usable locale"
info "Available locales:"
locale -a
fail "No usable locale, aborting..."
fi
info "Using locale $LANG..."
export LC_ALL=$LANG
shopt -o -s pipefail
else
error "Failed to find usable locale"
info "Available locales:"
locale -a
fail "No usable locale, aborting..."
info "No 'locale' binary found, skipping locale setup..."
fi
info "Using locale $LANG..."
export LC_ALL=$LANG
shopt -o -s pipefail
}

2 changes: 1 addition & 1 deletion .github/scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
export PATH="$HOME/.local/bin:$PATH"

export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
export BOOTSTRAP_HASKELL_CABAL_VERSION="${CABAL_VER:-3.10.2.0}"
export BOOTSTRAP_HASKELL_CABAL_VERSION="${CABAL_VER:-3.10.2.1}"
export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=no
export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes
export BOOTSTRAP_HASKELL_ADJUST_BASHRC=1
Expand Down
2 changes: 2 additions & 0 deletions .github/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ test_all_hls() {
fi
fi
done
ghcup install ghc --set recommended
"$bindir/haskell-language-server-wrapper${ext}" typecheck "${test_module}" || fail "failed to typecheck with HLS wrapper"
ghcup rm ghc "$(ghc --numeric-version)"
}

uname -a
Expand Down
Loading

0 comments on commit 784d9af

Please sign in to comment.