Skip to content

Commit

Permalink
Add ghc-head to the github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaov committed Jun 10, 2024
1 parent e15a95f commit 9dc8de0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/packcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
# For updating see: https://downloads.haskell.org/~ghcup/
GHCUP_VERSION: 0.1.20.0
GHCVER: ${{ matrix.ghc_version }}
GHCUP_GHC_OPTIONS: ${{ matrix.ghcup_ghc_options }}
# RESOLVER: ${{ matrix.stack_resolver }}

# ------------------------------------------------------------------------
Expand All @@ -68,7 +69,7 @@ jobs:
# ------------------------------------------------------------------------
CABAL_CHECK_RELAX: y
CABAL_HACKAGE_MIRROR: "hackage.haskell.org:http://hackage.fpcomplete.com"
CABAL_PROJECT: "cabal.project"
CABAL_PROJECT: ${{ matrix.cabal_project }}

# ------------------------------------------------------------------------
# Where to find the required tools
Expand Down Expand Up @@ -110,19 +111,30 @@ jobs:
# Adding any element to the list will increase the number of matrix
# elements proportional to the cross product.
include:

- name: ci
command: cabal
runner: ubuntu-latest
ghc_version: head
cabal_project: cabal.project.ghc-head
ghcup_ghc_options: -u https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-linux-deb10-int_native-validate.tar.xz?job=x86_64-linux-deb10-int_native-validate

- name: ci
command: cabal
runner: ubuntu-latest
ghc_version: 9.8.1
cabal_project: cabal.project

- name: ci
command: stack
runner: ubuntu-latest
cabal_project: cabal.project

- name: ci
ghc_version: 9.8.1
command: cabal
runner: macos-latest
cabal_project: cabal.project

- name: ci
command: hlint
Expand Down
18 changes: 18 additions & 0 deletions cabal.project.ghc-head
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- See head.hackage:
-- info at https://ghc.gitlab.haskell.org/head.hackage/
-- source at https://gitlab.haskell.org/ghc/head.hackage/

packages: packcheck.cabal

repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
key-threshold: 3
root-keys:
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d

active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override

allow-newer: all
3 changes: 2 additions & 1 deletion packcheck.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ synopsis: Universal build and CI testing for Haskell packages
description:
This package contains a universal CI/build script @packcheck.sh@ and config
files designed such that you can just copy over
@.github\/workflows/packcheck.yml@, @appveyor.yml@ or @.circleci/config.yml@
@.github\/workflows/packcheck.yml@, @appveyor.yml@ or @.circleci/config.yml@
to your package repo and your package is CI ready
in a jiffy. You can build and test packages on local machine as well. For
local testing, copy @packcheck.sh@ to your local machine, put it in your
Expand Down Expand Up @@ -54,6 +54,7 @@ extra-source-files:
appveyor.yml
cabal.project.coveralls
cabal.project
cabal.project.ghc-head
packcheck.sh
packcheck-safe.sh
packcheck-remote.sh
Expand Down
13 changes: 12 additions & 1 deletion packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ function run_verbose() {
bash -c "$*"
}

function run_verbose_errexit_with() {
local errScript="$1";
shift
if ! run_verbose "$*";
then
eval "$errScript"
die "Command [$*] failed. Exiting."
fi
}

function run_verbose_errexit() {
run_verbose "$*" || die "Command [$*] failed. Exiting."
}
Expand Down Expand Up @@ -942,7 +952,8 @@ ghcup_install() {

if test "$tool" = "ghc"
then
run_verbose_errexit ghcup install ghc $GHCUP_GHC_OPTIONS $tool_ver
run_verbose_errexit_with "cat /usr/local/.ghcup/logs/*" \
ghcup install ghc $GHCUP_GHC_OPTIONS $tool_ver
else
run_verbose_errexit ghcup install $tool $tool_ver
fi
Expand Down

0 comments on commit 9dc8de0

Please sign in to comment.