Skip to content
Merged

CI #27

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 267 additions & 0 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20251211
#
# REGENDATA ("0.19.20251211",["github","cabal.project"])
#
name: Haskell-CI
on:
- push
- pull_request
- merge_group
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-24.04
timeout-minutes:
60
container:
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.14.0.20251128
compilerKind: ghc
compilerVersion: 9.14.0.20251128
setup-method: ghcup-prerelease
allow-failure: false
- compiler: ghc-9.12.1
compilerKind: ghc
compilerVersion: 9.12.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.7
compilerKind: ghc
compilerVersion: 9.6.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
compilerKind: ghc
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
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"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Install GHC (GHCup prerelease)
if: matrix.setup-method == 'ghcup-prerelease'
run: |
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
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"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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 [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: env
run: |
env
- name: write cabal config
run: |
mkdir -p $CABAL_DIR
cat >> $CABAL_CONFIG <<EOF
remote-build-reporting: anonymous
write-ghc-environment-files: never
remote-repo-cache: $CABAL_DIR/packages
logs-dir: $CABAL_DIR/logs
world-file: $CABAL_DIR/world
extra-prog-path: $CABAL_DIR/bin
symlink-bindir: $CABAL_DIR/bin
installdir: $CABAL_DIR/bin
build-summary: $CABAL_DIR/logs/build.log
store-dir: $CABAL_DIR/store
install-dirs user
prefix: $CABAL_DIR
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
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
EOF
cat $CABAL_CONFIG
- name: versions
run: |
$HC --version || true
$HC --print-project-git-commit-id || true
$CABAL --version || true
- name: update cabal index
run: |
$CABAL v2-update -v
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v5
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/edison-api" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/edison-core" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/test" >> cabal.project
cat cabal.project
- name: sdist
run: |
mkdir -p sdist
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
- name: unpack
run: |
mkdir -p unpacked
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
- name: generate cabal.project
run: |
PKGDIR_EdisonAPI="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/EdisonAPI-[0-9.]*')"
echo "PKGDIR_EdisonAPI=${PKGDIR_EdisonAPI}" >> "$GITHUB_ENV"
PKGDIR_EdisonCore="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/EdisonCore-[0-9.]*')"
echo "PKGDIR_EdisonCore=${PKGDIR_EdisonCore}" >> "$GITHUB_ENV"
PKGDIR_Edison_test="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/Edison-test-[0-9.]*')"
echo "PKGDIR_Edison_test=${PKGDIR_Edison_test}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_EdisonAPI}" >> cabal.project
echo "packages: ${PKGDIR_EdisonCore}" >> cabal.project
echo "packages: ${PKGDIR_Edison_test}" >> cabal.project
echo "package EdisonAPI" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
echo "package EdisonCore" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
echo "package Edison-test" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "package EdisonAPI" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "package EdisonCore" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "package Edison-test" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "package EdisonAPI" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "package EdisonCore" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo "package Edison-test" >> cabal.project ; fi
if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
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: any.$_ installed\n" unless /^(Edison-test|EdisonAPI|EdisonCore)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
- name: build w/o tests
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: build
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: cabal check
run: |
cd ${PKGDIR_EdisonAPI} || false
${CABAL} -vnormal check
cd ${PKGDIR_EdisonCore} || false
${CABAL} -vnormal check
cd ${PKGDIR_Edison_test} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
3 changes: 2 additions & 1 deletion edison-api/EdisonAPI.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Description:
Associative Collections such as finite maps and priority queues
where the priority and element are distinct.
Extra-Source-Files: CHANGES.md
tested-with: GHC == 8.10.7, GHC == 9.6.7, GHC == 9.12.1, GHC == 9.14.1

Source-Repository head
Type: git
Expand All @@ -39,7 +40,7 @@ Library
Data.Edison.Seq
Data.Edison.Seq.ListSeq
Build-Depends:
base >= 4.12 && < 4.22
base >= 4.12 && < 4.23
if impl(ghc < 8.0)
build-depends: fail < 5
Default-Language: Haskell2010
Expand Down
11 changes: 5 additions & 6 deletions edison-core/EdisonCore.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Description:
implementations in this package have no dependencies other than those
commonly bundled with Haskell compilers.
Extra-Source-Files: CHANGES.md

tested-with: GHC == 8.10.7, GHC == 9.6.7, GHC == 9.12.1, GHC == 9.14.1

Source-Repository head
Type: git
Expand Down Expand Up @@ -54,11 +54,10 @@ Library
Data.Edison.Seq.SimpleQueue
Data.Edison.Seq.SizedSeq
Build-Depends:
base >= 4.12 && < 4.22,
base >= 4.12 && < 4.23,
QuickCheck >= 2.8.2 && < 3,
EdisonAPI >= 1.3.3 && < 1.4,
containers < 0.8,
array < 0.6
containers < 0.8

if impl(ghc < 8.0)
Build-Depends:
Expand All @@ -77,6 +76,6 @@ Library
ScopedTypeVariables
GeneralizedNewtypeDeriving
FlexibleContexts
Ghc-Options: -funbox-strict-fields -fwarn-incomplete-patterns
Ghc-Options: -funbox-strict-fields -Wall -Wno-name-shadowing -Wno-noncanonical-monad-instances
if impl(ghc >= 8.0)
Ghc-Options: -Wcompat
Ghc-Options: -Wcompat
4 changes: 2 additions & 2 deletions edison-core/src/Data/Edison/Assoc/AssocList.hs
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ instance (Eq k,Arbitrary k,Arbitrary a) => Arbitrary (FM k a) where
return (Prelude.foldr (uncurry insert) empty xs)

instance (Eq k,CoArbitrary k,CoArbitrary a) => CoArbitrary (FM k a) where
coarbitrary E = variant 0
coarbitrary (I k a m) = variant 1 . coarbitrary k
coarbitrary E = variant (0 :: Int)
coarbitrary (I k a m) = variant (1 :: Int) . coarbitrary k
. coarbitrary a . coarbitrary m


Expand Down
8 changes: 6 additions & 2 deletions edison-core/src/Data/Edison/Assoc/Defaults.hs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ readsPrecUsingFromList _ xs =

-- play games with the typechecker so we don't have to use
-- extensions for scoped type variables
~[(x,_)] = result
x = case result of
[(x',_)] -> x'
_ -> undefined

in result

Expand All @@ -295,7 +297,9 @@ readsPrecUsingUnsafeFromOrdSeq i xs =

-- play games with the typechecker so we don't have to use
-- extensions for scoped type variables
~[(x,_)] = result
x = case result of
[(x',_)] -> x'
_ -> undefined

in result

Expand Down
6 changes: 3 additions & 3 deletions edison-core/src/Data/Edison/Assoc/PatriciaLoMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,9 @@ instance (Arbitrary a) => Arbitrary (FM a) where
return (Prelude.foldr (uncurry insert) empty xs)

instance (CoArbitrary a) => CoArbitrary (FM a) where
coarbitrary E = variant 0
coarbitrary (L i a) = variant 1 . coarbitrary i . coarbitrary a
coarbitrary (B i j m n) = variant 2 . coarbitrary i . coarbitrary j
coarbitrary E = variant (0 :: Int)
coarbitrary (L i a) = variant (1 :: Int) . coarbitrary i . coarbitrary a
coarbitrary (B i j m n) = variant (2 :: Int) . coarbitrary i . coarbitrary j
. coarbitrary m . coarbitrary n


Expand Down
8 changes: 4 additions & 4 deletions edison-core/src/Data/Edison/Assoc/TernaryTrie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1152,13 +1152,13 @@ instance (Ord k,CoArbitrary k,CoArbitrary a) => CoArbitrary (FM k a) where

coarbitrary_maybe :: (CoArbitrary t) => Maybe t -> Test.QuickCheck.Gen b
-> Test.QuickCheck.Gen b
coarbitrary_maybe Nothing = variant 0
coarbitrary_maybe (Just x) = variant 1 . coarbitrary x
coarbitrary_maybe Nothing = variant (0 :: Int)
coarbitrary_maybe (Just x) = variant (1 :: Int) . coarbitrary x

coarbitrary_fmb :: (CoArbitrary t1, CoArbitrary t) => FMB t t1 -> Gen a -> Gen a
coarbitrary_fmb E = variant 0
coarbitrary_fmb E = variant (0 :: Int)
coarbitrary_fmb (I _ k x l (FMB' m) r) =
variant 1 . coarbitrary k . coarbitrary_maybe x .
variant (1 :: Int) . coarbitrary k . coarbitrary_maybe x .
coarbitrary_fmb l . coarbitrary_fmb m . coarbitrary_fmb r

instance Ord k => Semigroup (FM k a) where
Expand Down
4 changes: 3 additions & 1 deletion edison-core/src/Data/Edison/Coll/Defaults.hs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ readsPrecUsingFromList _ xs =

-- play games with the typechecker so we don't have to use
-- extensions for scoped type variables
~[(x,_)] = result
x = case result of
[(x',_)] -> x'
_ -> undefined

in result

Expand Down
Loading