Skip to content

Commit

Permalink
Require building with singletons-3.4/GHC 9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed May 12, 2024
1 parent 1d21d6f commit a87e774
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 20 deletions.
38 changes: 26 additions & 12 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.17.20231010
# version: 0.19.20240512
#
# REGENDATA ("0.17.20231010",["github","cabal.project"])
# REGENDATA ("0.19.20240512",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -23,14 +23,14 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.8.1
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.8.1
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
fail-fast: false
Expand All @@ -40,10 +40,10 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
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.1.0 || (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 }}
Expand All @@ -61,12 +61,12 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$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"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "HEADHACKAGE=true" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
Expand Down Expand Up @@ -95,6 +95,17 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
Expand All @@ -118,7 +129,7 @@ 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
Expand Down Expand Up @@ -148,6 +159,9 @@ jobs:
package eliminators
ghc-options: -Werror
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(eliminators)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
Expand All @@ -156,7 +170,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 @@ -179,7 +193,7 @@ jobs:
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### next [????.??.??]
* Require `singletons-base-3.4` and GHC 9.10.

### 0.9.4 [2023.10.13]
* Require `singletons-base-3.3` and GHC 9.8.

Expand Down
5 changes: 4 additions & 1 deletion cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
distribution: bionic
distribution: jammy
no-tests-no-benchmarks: False
unconstrained: False
local-ghc-options: -Werror
-- 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
14 changes: 7 additions & 7 deletions eliminators.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ category: Dependent Types
build-type: Simple
extra-source-files: CHANGELOG.md, README.md
cabal-version: >=1.10
tested-with: GHC == 9.8.1
tested-with: GHC == 9.10.1

source-repository head
type: git
Expand All @@ -30,14 +30,14 @@ library
Data.Eliminator.TH
Data.Eliminator.TypeLits
Data.Eliminator.TypeNats
build-depends: base >= 4.19 && < 4.20
build-depends: base >= 4.20 && < 4.21
, extra >= 1.4.2 && < 1.8
, singletons-base >= 3.3 && < 3.4
, singletons-base >= 3.4 && < 3.5
, singleton-nats >= 0.4.2 && < 0.5
, template-haskell >= 2.21 && < 2.22
, template-haskell >= 2.22 && < 2.23
, text >= 2.0.1 && < 2.2
, th-abstraction >= 0.4 && < 0.8
, th-desugar >= 1.16 && < 1.17
, th-desugar >= 1.17 && < 1.18
hs-source-dirs: src
default-language: GHC2021
ghc-options: -Wall -Wcompat -Wno-unticked-promoted-constructors -fenable-th-splice-warnings
Expand All @@ -58,10 +58,10 @@ test-suite spec
PolyRecTypes
VecTypes
VecSpec
build-depends: base >= 4.19 && < 4.20
build-depends: base >= 4.20 && < 4.21
, eliminators
, hspec >= 2 && < 3
, singletons-base >= 3.3 && < 3.4
, singletons-base >= 3.4 && < 3.5
, singleton-nats >= 0.4.2 && < 0.5
build-tool-depends: hspec-discover:hspec-discover
hs-source-dirs: tests
Expand Down
1 change: 1 addition & 0 deletions tests/DecideTypes.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeAbstractions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-unused-foralls #-}
Expand Down
1 change: 1 addition & 0 deletions tests/EqualityTypes.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeAbstractions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
Expand Down
1 change: 1 addition & 0 deletions tests/GADTSpec.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeAbstractions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module GADTSpec where
Expand Down
1 change: 1 addition & 0 deletions tests/ListTypes.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeAbstractions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module ListTypes where
Expand Down
1 change: 1 addition & 0 deletions tests/PolyRecTypes.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeAbstractions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module PolyRecTypes where
Expand Down
1 change: 1 addition & 0 deletions tests/VecTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoStarIsType #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeAbstractions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module VecTypes where
Expand Down

0 comments on commit a87e774

Please sign in to comment.