Skip to content

Commit

Permalink
Merge branch 'ghcup-setup'
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Dec 27, 2024
2 parents fa33a81 + d073b45 commit 4532d9a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 38 deletions.
3 changes: 0 additions & 3 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ set -eux

git_describe

# ensure ghcup
install_ghcup

# ensure cabal-cache
download_cabal_cache "$HOME/.local/bin/cabal-cache"

Expand Down
25 changes: 0 additions & 25 deletions .github/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,31 +132,6 @@ build_with_cache() {
sync_to
}

install_ghcup() {
case "${RUNNER_OS}" in
"Linux")
case "${ARCH}" in
"ARM"*)
if command -v ghcup ; then
mkdir -p "$GHCUP_BIN"
cp "$(command -v ghcup)" "$GHCUP_BIN/ghcup${ext}"
else
install_ghcup_curl_sh
fi
;;
*) install_ghcup_curl_sh
;;
esac
;;
*) install_ghcup_curl_sh
;;
esac
}

install_ghcup_curl_sh() {
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
}

strip_binary() {
(
set -e
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/cabal.project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ jobs:
sudo apt update
sudo apt install -y libbz2-dev
- name: Install GHCup
uses: haskell/ghcup-setup@v1

- name: Run build
run: |
env
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh
[ -e ~/.ghcup/env ] && source ~/.ghcup/env
ghcup --version
ghcup run -i --cabal latest --ghc ${GHC_VER} -- cabal update
ghcup run -i --cabal latest --ghc ${GHC_VER} -- cabal build -w ghc-${GHC_VER}
env:
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ jobs:
with:
submodules: 'true'

- name: Install GHCup
uses: haskell/ghcup-setup@v1

- if: matrix.ARCH == 'ARM64' && runner.os == 'macOS'
name: Run build
run: |
Expand Down Expand Up @@ -280,13 +283,19 @@ jobs:
with:
submodules: 'true'

- name: Run build
- name: Install prerequisites
run: |
sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
sudo pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x llvm14 libiconv curl gcc gmp gmake ncurses perl5 pkgconf libffi
sudo tzsetup Etc/GMT
sudo adjkerntz -a
bash .github/scripts/build.sh
- name: Install GHCup
uses: haskell/ghcup-setup@v1

- name: Run build
run: bash .github/scripts/build.sh

- if: always()
name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -485,6 +494,9 @@ jobs:
with:
submodules: 'true'

- name: Install GHCup
uses: haskell/ghcup-setup@v1

- uses: actions/download-artifact@v3
with:
name: artifacts
Expand Down Expand Up @@ -547,6 +559,13 @@ jobs:
with:
submodules: 'true'

- name: Install prerequisites
run: |
sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
sudo pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x llvm14 libiconv curl gcc gmp gmake ncurses perl5 pkgconf libffi
sudo tzsetup Etc/GMT
sudo adjkerntz -a
- uses: actions/download-artifact@v3
with:
name: artifacts
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ jobs:
sudo apt update
sudo apt install -y libbz2-dev
- name: Install GHCup
uses: haskell/ghcup-setup@v1

- name: Run build
run: |
env
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh
[ -e ~/.ghcup/env ] && source ~/.ghcup/env
ghcup --version
ghcup run -i --stack latest -- stack build
shell: bash

0 comments on commit 4532d9a

Please sign in to comment.