Skip to content

Commit

Permalink
Regenerate CI to use Jammy Jellyfish, test GHC 9.10.1
Browse files Browse the repository at this point in the history
This requires a more recent version of `haskell-ci` that supports GHC 9.10.1.
Another change that this more recent version of `haskell-ci` introduces is that
it drops support for pre-20.04 versions of Ubuntu, so we must also upgrade to a
more recent version of Ubuntu (I chose Ubuntu 22.04, or Jammy Jellyfish).

Unfortunately, `haskell-ci`'s GHCJS support no longer works with recent
versions of Ubuntu (see haskell-CI/haskell-ci#723),
so I had to remove the GHCJS configuration from the CI. This does not mean that
`singletons` is dropping JavaScript support, however, as we still plan to
support building the `singletons` library with GHC's JavaScript backend (the
modern successor to GHCJS).

There is currently no way to set up a GHC JavaScript backend CI job using
`haskell-ci`, and the amount of setup required to manually create one is such
that I'm putting it off for now. If someone asks for it, we can add one later.
  • Loading branch information
RyanGlScott committed May 4, 2024
1 parent 02d65bd commit 187b737
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 104 deletions.
143 changes: 53 additions & 90 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.18.1
# version: 0.19.20240501
#
# REGENDATA ("0.18.1",["github","cabal.project"])
# REGENDATA ("0.19.20240501",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -23,29 +23,29 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghcjs-8.4
compilerKind: ghcjs
compilerVersion: "8.4"
setup-method: hvr-ppa
- compiler: ghc-9.10.0.20240426
compilerKind: ghc
compilerVersion: 9.10.0.20240426
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.1
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.1
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.2
- compiler: ghc-9.6.5
compilerKind: ghc
compilerVersion: 9.6.2
compilerVersion: 9.6.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.5
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.5
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.7
Expand All @@ -66,99 +66,65 @@ jobs:
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.6.5
compilerKind: ghc
compilerVersion: 8.6.5
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.4.4
compilerKind: ghc
compilerVersion: 8.4.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.0.2
compilerKind: ghc
compilerVersion: 8.0.2
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: Set GHCJS environment variables
run: |
if [ $HCKIND = ghcjs ]; then
echo "GHCJS=true" >> "$GITHUB_ENV"
echo "GHCJSARITH=1" >> "$GITHUB_ENV"
else
echo "GHCJS=false" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
fi
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: apt
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
else
apt-add-repository -y 'ppa:hvr/ghc'
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi
if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x bionic main' ; fi
apt-get update
if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -194,7 +160,6 @@ jobs:
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
Expand All @@ -207,8 +172,6 @@ jobs:
$HC --version || true
$HC --print-project-git-commit-id || true
$CABAL --version || true
if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi
if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi
- name: update cabal index
run: |
$CABAL v2-update -v
Expand All @@ -222,15 +185,15 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./singletons" >> cabal.project
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-th" >> cabal.project ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-th" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base" >> cabal.project ; fi
cat cabal.project
- name: sdist
run: |
Expand All @@ -252,14 +215,14 @@ jobs:
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_singletons}" >> cabal.project
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_th}" >> cabal.project ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base}" >> cabal.project ; fi
if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package singletons" >> cabal.project ; fi
if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "package singletons-th" >> cabal.project ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "package singletons-base" >> cabal.project ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_th}" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base}" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package singletons" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "package singletons-th" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "package singletons-base" >> cabal.project ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
source-repository-package
type: git
Expand All @@ -277,7 +240,7 @@ jobs:
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -291,20 +254,20 @@ jobs:
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: tests
run: |
if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: cabal check
run: |
cd ${PKGDIR_singletons} || false
${CABAL} -vnormal check
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then cd ${PKGDIR_singletons_th} || false ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then cd ${PKGDIR_singletons_base} || false ; fi
if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then cd ${PKGDIR_singletons_th} || false ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then cd ${PKGDIR_singletons_base} || false ; fi
if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
- name: haddock
run: |
if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi
$CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ Compatibility
windows for requirements on the compiler version needed to build each library:

* `singletons` is a minimal library, and as such, it has a relatively
wide support window. `singletons` must be built with one of the following
compilers:

* GHC 8.0 or greater
* GHCJS
wide support window. `singletons` must be built with GHC 8.0 or later.
`singletons` aims to support cross-compilers as well (e.g., GHC's JavaScript
backend).
* `singletons-th` and `singletons-base` require use of many bleeding-edge
GHC language extensions, even more so than `singletons` itself. As such, it
is difficult to maintain support for multiple GHC versions in any given
Expand Down
7 changes: 4 additions & 3 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
distribution: bionic
distribution: jammy
no-tests-no-benchmarks: False
unconstrained: False
jobs-selection: any
-- Needed to avoid https://github.com/haskell/cabal/issues/5423
haddock-components: libs
-- Temporarily use head.hackage for GHC 9.8 until the ecosystem catches up
head-hackage: >= 9.8
-- Using `active-repositories: ..., head.hackage.ghc.haskell.org:override`
-- tends not to work well with singletons-base's custom Setup script.
head-hackage-override: False
2 changes: 1 addition & 1 deletion singletons-base/singletons-base.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ author: Richard Eisenberg <[email protected]>, Jan Stolarek <jan.stola
maintainer: Ryan Scott <[email protected]>
bug-reports: https://github.com/goldfirere/singletons/issues
stability: experimental
tested-with: GHC == 9.8.1
tested-with: GHC == 9.10.1
extra-source-files: README.md, CHANGES.md, tests/README.md,
tests/compile-and-dump/GradingClient/*.hs,
tests/compile-and-dump/InsertionSort/*.hs,
Expand Down
2 changes: 1 addition & 1 deletion singletons-th/singletons-th.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ author: Richard Eisenberg <[email protected]>, Jan Stolarek <jan.stola
maintainer: Ryan Scott <[email protected]>
bug-reports: https://github.com/goldfirere/singletons/issues
stability: experimental
tested-with: GHC == 9.8.1
tested-with: GHC == 9.10.1
extra-source-files: README.md, CHANGES.md
license: BSD3
license-file: LICENSE
Expand Down
8 changes: 4 additions & 4 deletions singletons/singletons.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ tested-with: GHC == 8.0.2
, GHC == 8.10.7
, GHC == 9.0.2
, GHC == 9.2.7
, GHC == 9.4.5
, GHC == 9.6.2
, GHC == 9.8.1
, GHCJS==8.4
, GHC == 9.4.8
, GHC == 9.6.5
, GHC == 9.8.2
, GHC == 9.10.1
extra-source-files: README.md, CHANGES.md
license: BSD3
license-file: LICENSE
Expand Down

0 comments on commit 187b737

Please sign in to comment.