Improve CI
This commit is contained in:
parent
e00899d176
commit
ba274307c0
@ -5,7 +5,7 @@ build_task:
|
|||||||
name: build
|
name: build
|
||||||
env:
|
env:
|
||||||
GHC_VER: 9.2.4
|
GHC_VER: 9.2.4
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.8.1.0
|
||||||
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
||||||
ARCH: 64
|
ARCH: 64
|
||||||
RUNNER_OS: FreeBSD
|
RUNNER_OS: FreeBSD
|
||||||
|
2
.github/scripts/bootstrap.sh
vendored
2
.github/scripts/bootstrap.sh
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
. .github/scripts/env.sh
|
||||||
|
|
||||||
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
||||||
|
|
||||||
|
27
.github/scripts/brew.sh
vendored
Normal file
27
.github/scripts/brew.sh
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
. .github/scripts/env.sh
|
||||||
|
|
||||||
|
if [ -e "$HOME/.brew" ] ; then
|
||||||
|
(
|
||||||
|
cd "$HOME/.brew"
|
||||||
|
git fetch --depth 1
|
||||||
|
git reset --hard origin/master
|
||||||
|
)
|
||||||
|
else
|
||||||
|
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
|
||||||
|
fi
|
||||||
|
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
||||||
|
|
||||||
|
mkdir -p $CI_PROJECT_DIR/.brew_cache
|
||||||
|
export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
|
||||||
|
mkdir -p $CI_PROJECT_DIR/.brew_logs
|
||||||
|
export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
|
||||||
|
mkdir -p /private/tmp/.brew_tmp
|
||||||
|
export HOMEBREW_TEMP=/private/tmp/.brew_tmp
|
||||||
|
|
||||||
|
brew update
|
||||||
|
brew install ${1+"$@"}
|
||||||
|
|
71
.github/scripts/build.sh
vendored
71
.github/scripts/build.sh
vendored
@ -2,72 +2,31 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
|
||||||
. .github/scripts/common.sh
|
. .github/scripts/common.sh
|
||||||
|
|
||||||
|
|
||||||
# ensure ghcup
|
|
||||||
if ! command -v ghcup ; then
|
|
||||||
install_ghcup
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ensure cabal-cache
|
|
||||||
if ! cabal-cache version ; then
|
|
||||||
download_cabal_cache "$HOME/.local/bin/cabal-cache"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ensure ghc
|
|
||||||
if [ "${RUNNER_OS}" != "FreeBSD" ] ; then
|
|
||||||
if [ "${DISTRO}" != "Debian" ] ; then # ! armv7 or aarch64 linux
|
|
||||||
if ! "ghc-${GHC_VER}" --numeric-version ; then
|
|
||||||
ghcup -v install ghc --set --force "$GHC_VER"
|
|
||||||
fi
|
|
||||||
if [ "$(cabal --numeric-version || true)" != "${CABAL_VER}" ] ; then
|
|
||||||
ghcup -v install cabal --force "$CABAL_VER"
|
|
||||||
fi
|
|
||||||
ghc --version
|
|
||||||
cabal --version
|
|
||||||
GHC="ghc-${GHC_VER}"
|
|
||||||
else
|
|
||||||
if [ "$(cabal --numeric-version || true)" != "${CABAL_VER}" ] ; then
|
|
||||||
ghcup -v install cabal --force "$CABAL_VER"
|
|
||||||
fi
|
|
||||||
cabal --version
|
|
||||||
GHC="ghc"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
ghc --version
|
|
||||||
cabal --version
|
|
||||||
GHC="ghc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
git_describe
|
git_describe
|
||||||
|
|
||||||
|
# ensure ghcup
|
||||||
|
install_ghcup
|
||||||
|
|
||||||
|
# ensure cabal-cache
|
||||||
|
download_cabal_cache "$HOME/.local/bin/cabal-cache"
|
||||||
|
|
||||||
|
# install toolchain (if necessary)
|
||||||
|
ghcup -v install ghc --set --force "$GHC_VER"
|
||||||
|
ghcup -v install cabal --force "$CABAL_VER"
|
||||||
|
ghc --version
|
||||||
|
cabal --version
|
||||||
|
GHC="ghc-${GHC_VER}"
|
||||||
|
|
||||||
# build
|
# build
|
||||||
ecabal update
|
ecabal update
|
||||||
|
build_with_cache --project-file=cabal.project.release -w "${GHC}" --enable-tests
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
if [ "${ARCH}" = "32" ] ; then
|
|
||||||
build_with_cache -w "${GHC}" --ghc-options='-split-sections -optl-static' -ftui --enable-tests
|
|
||||||
elif [ "${ARCH}" = "64" ] ; then
|
|
||||||
build_with_cache -w "${GHC}" --ghc-options='-split-sections -optl-static' -ftui --enable-tests
|
|
||||||
else
|
|
||||||
build_with_cache -w "${GHC}" -ftui --enable-tests
|
|
||||||
fi
|
|
||||||
elif [ "${RUNNER_OS}" = "FreeBSD" ] ; then
|
|
||||||
build_with_cache -w "${GHC}" --ghc-options='-split-sections -pgmc clang++14' --constraint="zlib +bundled-c-zlib" --constraint="zip +disable-zstd" -ftui --enable-tests
|
|
||||||
elif [ "${RUNNER_OS}" = "Windows" ] ; then
|
|
||||||
build_with_cache -w "${GHC}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" --constraint="text -simdutf" --enable-tests
|
|
||||||
else
|
|
||||||
build_with_cache -w "${GHC}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui --enable-tests
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# set up artifacts
|
# set up artifacts
|
||||||
mkdir -p out
|
mkdir -p out
|
||||||
binary=$(cabal list-bin ghcup)
|
binary=$(cabal --project-file=cabal.project.release list-bin ghcup)
|
||||||
binary_test=$(cabal list-bin ghcup-test)
|
binary_test=$(cabal --project-file=cabal.project.release list-bin ghcup-test)
|
||||||
ver=$("${binary}" --numeric-version)
|
ver=$("${binary}" --numeric-version)
|
||||||
strip_binary "${binary}"
|
strip_binary "${binary}"
|
||||||
cp "${binary}" "out/${ARTIFACT}-${ver}${ext}"
|
cp "${binary}" "out/${ARTIFACT}-${ver}${ext}"
|
||||||
|
41
.github/scripts/common.sh
vendored
41
.github/scripts/common.sh
vendored
@ -1,23 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
. .github/scripts/env.sh
|
||||||
ext=".exe"
|
|
||||||
else
|
|
||||||
ext=''
|
|
||||||
fi
|
|
||||||
|
|
||||||
ecabal() {
|
ecabal() {
|
||||||
cabal "$@"
|
cabal "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_from_retry() {
|
nonfatal() {
|
||||||
if [ "${RUNNER_OS}" != "Windows" ] ; then
|
"$@" || "$@ failed"
|
||||||
cabal_store_path="$(dirname "$(cabal help user-config | tail -n 1 | xargs)")/store"
|
|
||||||
else
|
|
||||||
cabal_store_path="${CABAL_DIR}/store"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sync_from || { sleep 9 ; rm -rf "${cabal_store_path:?}"/* ; sync_from || { sleep 20 ; rm -rf "${cabal_store_path:?}"/* ; sync_from ; } }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_from() {
|
sync_from() {
|
||||||
@ -34,10 +24,6 @@ sync_from() {
|
|||||||
--archive-uri "s3://ghcup-hs/${RUNNER_OS}-${ARCH}-${DISTRO}"
|
--archive-uri "s3://ghcup-hs/${RUNNER_OS}-${ARCH}-${DISTRO}"
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_to_retry() {
|
|
||||||
sync_to || { sleep 9 ; sync_to || { sleep 20 ; sync_to ; } }
|
|
||||||
}
|
|
||||||
|
|
||||||
sync_to() {
|
sync_to() {
|
||||||
if [ "${RUNNER_OS}" != "Windows" ] ; then
|
if [ "${RUNNER_OS}" != "Windows" ] ; then
|
||||||
cabal_store_path="$(dirname "$(cabal help user-config | tail -n 1 | xargs)")/store"
|
cabal_store_path="$(dirname "$(cabal help user-config | tail -n 1 | xargs)")/store"
|
||||||
@ -81,6 +67,7 @@ git_describe() {
|
|||||||
download_cabal_cache() {
|
download_cabal_cache() {
|
||||||
(
|
(
|
||||||
set -e
|
set -e
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
dest="$HOME/.local/bin/cabal-cache"
|
dest="$HOME/.local/bin/cabal-cache"
|
||||||
url=""
|
url=""
|
||||||
exe=""
|
exe=""
|
||||||
@ -134,25 +121,15 @@ download_cabal_cache() {
|
|||||||
build_with_cache() {
|
build_with_cache() {
|
||||||
ecabal configure "$@"
|
ecabal configure "$@"
|
||||||
ecabal build --dependencies-only "$@" --dry-run
|
ecabal build --dependencies-only "$@" --dry-run
|
||||||
sync_from_retry
|
sync_from
|
||||||
ecabal build --dependencies-only "$@" || sync_to_retry
|
ecabal build --dependencies-only "$@" || sync_to
|
||||||
sync_to_retry
|
sync_to
|
||||||
ecabal build "$@"
|
ecabal build "$@"
|
||||||
sync_to_retry
|
sync_to
|
||||||
}
|
}
|
||||||
|
|
||||||
install_ghcup() {
|
install_ghcup() {
|
||||||
find "$GHCUP_INSTALL_BASE_PREFIX"
|
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes sh
|
||||||
mkdir -p "$GHCUP_BIN"
|
|
||||||
mkdir -p "$GHCUP_BIN"/../cache
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "FreeBSD" ] ; then
|
|
||||||
curl -o ghcup https://downloads.haskell.org/ghcup/tmp/x86_64-portbld-freebsd-ghcup-0.1.18.1
|
|
||||||
chmod +x ghcup
|
|
||||||
mv ghcup "$HOME/.local/bin/ghcup"
|
|
||||||
else
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes sh
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
strip_binary() {
|
strip_binary() {
|
||||||
|
30
.github/scripts/env.sh
vendored
Normal file
30
.github/scripts/env.sh
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
||||||
|
ext=".exe"
|
||||||
|
else
|
||||||
|
ext=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
export TZ=Asia/Singapore
|
||||||
|
|
||||||
|
export OS="$RUNNER_OS"
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
||||||
|
# on windows use pwd to get unix style path
|
||||||
|
CI_PROJECT_DIR="$(pwd)"
|
||||||
|
export CI_PROJECT_DIR
|
||||||
|
export GHCUP_INSTALL_BASE_PREFIX="/c"
|
||||||
|
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin"
|
||||||
|
export PATH="$GHCUP_BIN:$PATH"
|
||||||
|
export CABAL_DIR="C:\\Users\\runneradmin\\AppData\\Roaming\\cabal"
|
||||||
|
else
|
||||||
|
export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
|
||||||
|
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
||||||
|
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin"
|
||||||
|
export PATH="$GHCUP_BIN:$PATH"
|
||||||
|
export CABAL_DIR="$CI_PROJECT_DIR/cabal"
|
||||||
|
export CABAL_CACHE="$CI_PROJECT_DIR/cabal-cache"
|
||||||
|
fi
|
7
.github/scripts/hls.sh
vendored
7
.github/scripts/hls.sh
vendored
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
|
||||||
. .github/scripts/common.sh
|
. .github/scripts/common.sh
|
||||||
|
|
||||||
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
||||||
@ -34,7 +33,7 @@ sha_sum "$(raw_eghcup --offline whereis ghcup)"
|
|||||||
git_describe
|
git_describe
|
||||||
|
|
||||||
eghcup install ghc "${GHC_VERSION}"
|
eghcup install ghc "${GHC_VERSION}"
|
||||||
eghcup install cabal
|
eghcup install cabal "${CABAL_VERSION}"
|
||||||
|
|
||||||
ecabal update
|
ecabal update
|
||||||
|
|
||||||
@ -57,9 +56,9 @@ eghcup debug-info
|
|||||||
cd "haskell-language-server-${HLS_TARGET_VERSION}/"
|
cd "haskell-language-server-${HLS_TARGET_VERSION}/"
|
||||||
ecabal configure -w "ghc-${GHC_VERSION}" --disable-profiling --disable-tests --jobs="$(nproc)"
|
ecabal configure -w "ghc-${GHC_VERSION}" --disable-profiling --disable-tests --jobs="$(nproc)"
|
||||||
ecabal build --dependencies-only -w "ghc-${GHC_VERSION}" --disable-profiling --disable-tests --jobs="$(nproc)" --dry-run
|
ecabal build --dependencies-only -w "ghc-${GHC_VERSION}" --disable-profiling --disable-tests --jobs="$(nproc)" --dry-run
|
||||||
sync_from_retry
|
sync_from
|
||||||
ecabal build --dependencies-only -w "ghc-${GHC_VERSION}" --disable-profiling --disable-tests --jobs="$(nproc)" || sync_to
|
ecabal build --dependencies-only -w "ghc-${GHC_VERSION}" --disable-profiling --disable-tests --jobs="$(nproc)" || sync_to
|
||||||
sync_to_retry
|
sync_to
|
||||||
)
|
)
|
||||||
|
|
||||||
eghcup -v compile hls -j "$(nproc)" -g "${HLS_TARGET_VERSION}" --ghc "${GHC_VERSION}"
|
eghcup -v compile hls -j "$(nproc)" -g "${HLS_TARGET_VERSION}" --ghc "${GHC_VERSION}"
|
||||||
|
66
.github/scripts/prereq.sh
vendored
66
.github/scripts/prereq.sh
vendored
@ -1,66 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
mkdir -p "$HOME"/.local/bin
|
|
||||||
|
|
||||||
export OS="$RUNNER_OS"
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
: "${APT_GET:=apt-get}"
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
|
||||||
# on windows use pwd to get unix style path
|
|
||||||
CI_PROJECT_DIR="$(pwd)"
|
|
||||||
export CI_PROJECT_DIR
|
|
||||||
export GHCUP_INSTALL_BASE_PREFIX="/c"
|
|
||||||
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin"
|
|
||||||
export PATH="$GHCUP_BIN:$PATH"
|
|
||||||
export CABAL_DIR="C:\\Users\\runneradmin\\AppData\\Roaming\\cabal"
|
|
||||||
else
|
|
||||||
export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
|
|
||||||
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
|
||||||
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin"
|
|
||||||
export PATH="$GHCUP_BIN:$PATH"
|
|
||||||
export CABAL_DIR="$CI_PROJECT_DIR/cabal"
|
|
||||||
export CABAL_CACHE="$CI_PROJECT_DIR/cabal-cache"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
if [ "${DISTRO}" = "Alpine" ] ; then
|
|
||||||
:
|
|
||||||
elif [ "${DISTRO}" = "Ubuntu" ] ; then
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
export TZ=Asia/Singapore
|
|
||||||
if [ "${ARCH}" = "ARM64" ] || [ "${ARCH}" = "ARM" ] ; then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
${APT_GET} install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl gzip
|
|
||||||
fi
|
|
||||||
elif [ "${DISTRO}" = "Debian" ] ; then
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
export TZ=Asia/Singapore
|
|
||||||
${APT_GET} install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip
|
|
||||||
fi
|
|
||||||
elif [ "${RUNNER_OS}" = "macOS" ] ; then
|
|
||||||
if ! command -v brew ; then
|
|
||||||
[ -e "$HOME/.brew" ] ||
|
|
||||||
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
|
|
||||||
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
|
||||||
brew update
|
|
||||||
fi
|
|
||||||
if ! command -v git ; then
|
|
||||||
brew install git
|
|
||||||
fi
|
|
||||||
if ! command -v realpath ; then
|
|
||||||
brew install coreutils
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}" = "ARM64" ] ; then
|
|
||||||
brew install llvm@11 autoconf automake
|
|
||||||
export PATH="$HOME/.brew/opt/llvm@11/bin:$PATH"
|
|
||||||
export CC="$HOME/.brew/opt/llvm@11/bin/clang"
|
|
||||||
export CXX="$HOME/.brew/opt/llvm@11/bin/clang++"
|
|
||||||
export LD=ld
|
|
||||||
export AR="$HOME/.brew/opt/llvm@11/bin/llvm-ar"
|
|
||||||
export RANLIB="$HOME/.brew/opt/llvm@11/bin/llvm-ranlib"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
1
.github/scripts/test.sh
vendored
1
.github/scripts/test.sh
vendored
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
|
||||||
. .github/scripts/common.sh
|
. .github/scripts/common.sh
|
||||||
|
|
||||||
|
|
||||||
|
11
.github/workflows/bootstrap.yaml
vendored
11
.github/workflows/bootstrap.yaml
vendored
@ -20,7 +20,6 @@ jobs:
|
|||||||
BOOTSTRAP_HASKELL_NONINTERACTIVE: yes
|
BOOTSTRAP_HASKELL_NONINTERACTIVE: yes
|
||||||
ARCH: 64
|
ARCH: 64
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
APT_GET: "sudo apt-get"
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -36,7 +35,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- if: runner.os != 'Windows'
|
- if: runner.os == 'Linux'
|
||||||
|
name: Run bootstrap
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl gzip
|
||||||
|
sh ./.github/scripts/bootstrap.sh
|
||||||
|
env:
|
||||||
|
DISTRO: ${{ matrix.DISTRO }}
|
||||||
|
|
||||||
|
- if: runner.os == 'macOS'
|
||||||
name: Run bootstrap
|
name: Run bootstrap
|
||||||
run: sh ./.github/scripts/bootstrap.sh
|
run: sh ./.github/scripts/bootstrap.sh
|
||||||
env:
|
env:
|
||||||
|
65
.github/workflows/docker.yaml
vendored
65
.github/workflows/docker.yaml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-alpine:
|
docker-alpine32:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -27,6 +27,21 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: hasufell/i386-alpine-haskell:3.12
|
tags: hasufell/i386-alpine-haskell:3.12
|
||||||
platforms: linux/i386
|
platforms: linux/i386
|
||||||
|
|
||||||
|
docker-alpine:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push (alpine 64bit)
|
- name: Build and push (alpine 64bit)
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
@ -35,34 +50,58 @@ jobs:
|
|||||||
tags: hasufell/alpine-haskell:3.12
|
tags: hasufell/alpine-haskell:3.12
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
|
||||||
docker-arm:
|
docker-arm32:
|
||||||
runs-on: [self-hosted, Linux, aarch64]
|
runs-on: [self-hosted, Linux, ARM64, aarch32-linux]
|
||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/ubuntu:focal
|
- uses: docker://arm64v8/ubuntu:focal
|
||||||
name: Cleanup
|
name: Cleanup (aarch64 linux)
|
||||||
with:
|
with:
|
||||||
args: rm -rf .ghcup/ cabal/ dist-newstyle/ out/
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push (arm64v8)
|
|
||||||
uses: docker/build-push-action@v3
|
- name: Build and push
|
||||||
with:
|
|
||||||
context: ./docker/arm64v8/
|
|
||||||
push: true
|
|
||||||
tags: hasufell/arm64v8-ubuntu-haskell:focal
|
|
||||||
platforms: linux/arm64
|
|
||||||
- name: Build and push (arm32v7)
|
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: ./docker/arm32v7
|
context: ./docker/arm32v7
|
||||||
push: true
|
push: true
|
||||||
tags: hasufell/arm32v7-ubuntu-haskell:focal
|
tags: hasufell/arm32v7-ubuntu-haskell:focal
|
||||||
platforms: linux/arm
|
platforms: linux/arm
|
||||||
|
|
||||||
|
docker-aarch:
|
||||||
|
runs-on: [self-hosted, Linux, ARM64]
|
||||||
|
steps:
|
||||||
|
- uses: docker://arm64v8/ubuntu:focal
|
||||||
|
name: Cleanup (aarch64 linux)
|
||||||
|
with:
|
||||||
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: ./docker/arm64v8/
|
||||||
|
push: true
|
||||||
|
tags: hasufell/arm64v8-ubuntu-haskell:focal
|
||||||
|
platforms: linux/arm64
|
||||||
|
98
.github/workflows/release.yaml
vendored
98
.github/workflows/release.yaml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
name: Build linux binary
|
name: Build linux binary
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.8.1.0
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
@ -81,7 +81,7 @@ jobs:
|
|||||||
name: Build ARM binary
|
name: Build ARM binary
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.8.1.0
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
@ -90,11 +90,11 @@ jobs:
|
|||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: [self-hosted, Linux, aarch64]
|
- os: [self-hosted, Linux, ARM64, aarch32-linux]
|
||||||
ARTIFACT: "armv7-linux-ghcup"
|
ARTIFACT: "armv7-linux-ghcup"
|
||||||
GHC_VER: 9.2.2
|
GHC_VER: 9.2.2
|
||||||
ARCH: ARM
|
ARCH: ARM
|
||||||
- os: [self-hosted, Linux, aarch64]
|
- os: [self-hosted, Linux, ARM64]
|
||||||
ARTIFACT: "aarch64-linux-ghcup"
|
ARTIFACT: "aarch64-linux-ghcup"
|
||||||
GHC_VER: 9.2.5
|
GHC_VER: 9.2.5
|
||||||
ARCH: ARM64
|
ARCH: ARM64
|
||||||
@ -154,7 +154,7 @@ jobs:
|
|||||||
name: Build binary (Mac/Win)
|
name: Build binary (Mac/Win)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.8.1.0
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.13
|
MACOSX_DEPLOYMENT_TARGET: 10.13
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
@ -164,7 +164,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: [self-hosted, macOS, aarch64]
|
- os: [self-hosted, macOS, ARM64]
|
||||||
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
||||||
GHC_VER: 9.2.5
|
GHC_VER: 9.2.5
|
||||||
ARCH: ARM64
|
ARCH: ARM64
|
||||||
@ -182,8 +182,48 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- name: Run build (windows/mac)
|
- if: matrix.ARCH == 'ARM64' && runner.os == 'macOS'
|
||||||
run: bash .github/scripts/build.sh
|
name: Run build
|
||||||
|
run: |
|
||||||
|
bash .github/scripts/brew.sh git coreutils llvm@11 autoconf automake
|
||||||
|
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$HOME/.brew/opt/llvm@11/bin:$PATH"
|
||||||
|
export CC="$HOME/.brew/opt/llvm@11/bin/clang"
|
||||||
|
export CXX="$HOME/.brew/opt/llvm@11/bin/clang++"
|
||||||
|
export LD=ld
|
||||||
|
export AR="$HOME/.brew/opt/llvm@11/bin/llvm-ar"
|
||||||
|
export RANLIB="$HOME/.brew/opt/llvm@11/bin/llvm-ranlib"
|
||||||
|
bash .github/scripts/build.sh
|
||||||
|
env:
|
||||||
|
ARTIFACT: ${{ matrix.ARTIFACT }}
|
||||||
|
ARCH: ${{ matrix.ARCH }}
|
||||||
|
GHC_VER: ${{ matrix.GHC_VER }}
|
||||||
|
DISTRO: na
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
|
||||||
|
S3_HOST: ${{ env.S3_HOST }}
|
||||||
|
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
|
||||||
|
|
||||||
|
- if: matrix.ARCH == '64' && runner.os == 'macOS'
|
||||||
|
name: Run build (windows/mac)
|
||||||
|
run: |
|
||||||
|
bash .github/scripts/brew.sh coreutils
|
||||||
|
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
||||||
|
bash .github/scripts/build.sh
|
||||||
|
env:
|
||||||
|
ARTIFACT: ${{ matrix.ARTIFACT }}
|
||||||
|
ARCH: ${{ matrix.ARCH }}
|
||||||
|
GHC_VER: ${{ matrix.GHC_VER }}
|
||||||
|
DISTRO: na
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
|
||||||
|
S3_HOST: ${{ env.S3_HOST }}
|
||||||
|
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
|
||||||
|
|
||||||
|
- if: runner.os == 'Windows'
|
||||||
|
name: Run build (windows/mac)
|
||||||
|
run: |
|
||||||
|
bash .github/scripts/brew.sh git coreutils autoconf automake
|
||||||
|
bash .github/scripts/build.sh
|
||||||
env:
|
env:
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
ARTIFACT: ${{ matrix.ARTIFACT }}
|
||||||
ARCH: ${{ matrix.ARCH }}
|
ARCH: ${{ matrix.ARCH }}
|
||||||
@ -202,13 +242,12 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
./out/*
|
./out/*
|
||||||
|
|
||||||
|
|
||||||
test-linux:
|
test-linux:
|
||||||
name: Test linux
|
name: Test linux
|
||||||
needs: "build-linux"
|
needs: "build-linux"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.8.1.0
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -264,13 +303,14 @@ jobs:
|
|||||||
|
|
||||||
- if: matrix.DISTRO != 'Alpine'
|
- if: matrix.DISTRO != 'Alpine'
|
||||||
name: Run test (64 bit linux)
|
name: Run test (64 bit linux)
|
||||||
run: sh .github/scripts/test.sh
|
run: |
|
||||||
|
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl gzip
|
||||||
|
sh .github/scripts/test.sh
|
||||||
env:
|
env:
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
ARTIFACT: ${{ matrix.ARTIFACT }}
|
||||||
ARCH: ${{ matrix.ARCH }}
|
ARCH: ${{ matrix.ARCH }}
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
GHC_VER: ${{ matrix.GHC_VER }}
|
||||||
DISTRO: ${{ matrix.DISTRO }}
|
DISTRO: ${{ matrix.DISTRO }}
|
||||||
APT_GET: "sudo apt-get"
|
|
||||||
|
|
||||||
- if: failure()
|
- if: failure()
|
||||||
name: Upload artifact
|
name: Upload artifact
|
||||||
@ -285,17 +325,17 @@ jobs:
|
|||||||
needs: "build-arm"
|
needs: "build-arm"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.8.1.0
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: [self-hosted, Linux, aarch64]
|
- os: [self-hosted, Linux, ARM64, aarch32-linux]
|
||||||
ARTIFACT: "armv7-linux-ghcup"
|
ARTIFACT: "armv7-linux-ghcup"
|
||||||
GHC_VER: 9.2.2
|
GHC_VER: 9.2.2
|
||||||
ARCH: ARM
|
ARCH: ARM
|
||||||
DISTRO: Ubuntu
|
DISTRO: Ubuntu
|
||||||
- os: [self-hosted, Linux, aarch64]
|
- os: [self-hosted, Linux, ARM64]
|
||||||
ARTIFACT: "aarch64-linux-ghcup"
|
ARTIFACT: "aarch64-linux-ghcup"
|
||||||
GHC_VER: 9.2.5
|
GHC_VER: 9.2.5
|
||||||
ARCH: ARM64
|
ARCH: ARM64
|
||||||
@ -352,13 +392,13 @@ jobs:
|
|||||||
needs: "build-macwin"
|
needs: "build-macwin"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
CABAL_VER: 3.8.1.0
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.13
|
MACOSX_DEPLOYMENT_TARGET: 10.13
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: [self-hosted, macOS, aarch64]
|
- os: [self-hosted, macOS, ARM64]
|
||||||
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
||||||
GHC_VER: 9.2.5
|
GHC_VER: 9.2.5
|
||||||
ARCH: ARM64
|
ARCH: ARM64
|
||||||
@ -385,7 +425,21 @@ jobs:
|
|||||||
name: artifacts
|
name: artifacts
|
||||||
path: ./out
|
path: ./out
|
||||||
|
|
||||||
- name: Run test (windows/mac)
|
- if: runner.os == 'macOS'
|
||||||
|
name: Run test
|
||||||
|
run: |
|
||||||
|
bash .github/scripts/brew.sh coreutils
|
||||||
|
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
||||||
|
bash .github/scripts/test.sh
|
||||||
|
env:
|
||||||
|
ARTIFACT: ${{ matrix.ARTIFACT }}
|
||||||
|
ARCH: ${{ matrix.ARCH }}
|
||||||
|
GHC_VER: ${{ matrix.GHC_VER }}
|
||||||
|
DISTRO: ${{ matrix.DISTRO }}
|
||||||
|
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
|
||||||
|
|
||||||
|
- if: runner.os != 'macOS'
|
||||||
|
name: Run test
|
||||||
run: bash .github/scripts/test.sh
|
run: bash .github/scripts/test.sh
|
||||||
env:
|
env:
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
ARTIFACT: ${{ matrix.ARTIFACT }}
|
||||||
@ -416,7 +470,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GHC_VERSION: "8.10.7"
|
GHC_VERSION: "8.10.7"
|
||||||
HLS_TARGET_VERSION: "1.8.0.0"
|
HLS_TARGET_VERSION: "1.8.0.0"
|
||||||
CABAL_VERSION: "3.6.2.0"
|
CABAL_VERSION: "3.8.1.0"
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
ARTIFACT: "x86_64-linux-ghcup"
|
ARTIFACT: "x86_64-linux-ghcup"
|
||||||
DISTRO: Ubuntu
|
DISTRO: Ubuntu
|
||||||
@ -436,9 +490,9 @@ jobs:
|
|||||||
path: ./out
|
path: ./out
|
||||||
|
|
||||||
- name: Run hls build
|
- name: Run hls build
|
||||||
run: sh .github/scripts/hls.sh
|
run: |
|
||||||
env:
|
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl gzip
|
||||||
APT_GET: "sudo apt-get"
|
sh .github/scripts/hls.sh
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: release
|
name: release
|
||||||
|
@ -2,8 +2,6 @@ packages: ./ghcup.cabal
|
|||||||
|
|
||||||
optional-packages: ./vendored/*/*.cabal
|
optional-packages: ./vendored/*/*.cabal
|
||||||
|
|
||||||
optimization: 2
|
|
||||||
|
|
||||||
package ghcup
|
package ghcup
|
||||||
flags: +tui
|
flags: +tui
|
||||||
|
|
||||||
|
50
cabal.project.release
Normal file
50
cabal.project.release
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
packages: ./ghcup.cabal
|
||||||
|
|
||||||
|
optional-packages: ./vendored/*/*.cabal
|
||||||
|
|
||||||
|
optimization: 2
|
||||||
|
|
||||||
|
if os(linux)
|
||||||
|
package ghcup
|
||||||
|
flags: +tui
|
||||||
|
if arch(x86_64) || arch(i386)
|
||||||
|
package *
|
||||||
|
ghc-options: -split-sections -optl-static
|
||||||
|
elif os(darwin)
|
||||||
|
constraints: zlib +bundled-c-zlib,
|
||||||
|
lzma +static
|
||||||
|
package ghcup
|
||||||
|
flags: +tui
|
||||||
|
elif os(mingw32)
|
||||||
|
constraints: zlib +bundled-c-zlib,
|
||||||
|
lzma +static,
|
||||||
|
text -simdutf
|
||||||
|
package ghcup
|
||||||
|
flags: -tui
|
||||||
|
elif os(freebsd)
|
||||||
|
constraints: zlib +bundled-c-zlib,
|
||||||
|
zip +disable-zstd
|
||||||
|
package *
|
||||||
|
ghc-options: -split-sections -pgmc clang++14
|
||||||
|
package ghcup
|
||||||
|
flags: +tui
|
||||||
|
|
||||||
|
constraints: http-io-streams -brotli,
|
||||||
|
any.aeson >= 2.0.1.0,
|
||||||
|
any.hsc2hs ==0.68.8
|
||||||
|
|
||||||
|
package libarchive
|
||||||
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
package aeson-pretty
|
||||||
|
flags: +lib-only
|
||||||
|
|
||||||
|
package cabal-plan
|
||||||
|
flags: -exe
|
||||||
|
|
||||||
|
package aeson
|
||||||
|
flags: +ordered-keymap
|
||||||
|
|
||||||
|
package streamly
|
||||||
|
flags: +use-unliftio
|
||||||
|
|
@ -1 +1 @@
|
|||||||
Subproject commit e6b0a8086ac05bf6adbb165e38f460c7fe11104e
|
Subproject commit 9e14e6c736736234981b8cb096492cab86db7b14
|
Loading…
Reference in New Issue
Block a user