Skip to content

Commit

Permalink
Release bounds, test with ghc 9.10 and 9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
edsko committed Jan 22, 2025
1 parent 2b7a8ae commit a00fe18
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 29 deletions.
65 changes: 41 additions & 24 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,40 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20240402
# version: 0.19.20250115
#
# REGENDATA ("0.19.20240402",["github","cabal.project.ci"])
# REGENDATA ("0.19.20250115",["github","cabal.project.ci"])
#
name: Haskell-CI
on:
- push
- pull_request
push:
branches:
- main
pull_request:
branches:
- main
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.12.1
compilerKind: ghc
compilerVersion: 9.12.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
Expand Down Expand Up @@ -55,18 +69,30 @@ jobs:
allow-failure: false
fail-fast: false
steps:
- name: apt
- 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
apt-get install -y libsnappy-dev
- name: Install GHCup
run: |
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"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.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;
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.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)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
apt-get update
apt-get install -y libsnappy-dev
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 }}
Expand All @@ -77,21 +103,12 @@ jobs:
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
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"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
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 @@ -141,7 +158,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 @@ -178,15 +195,15 @@ jobs:
benchmarks: True
ghc-options: -Werror
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(snappy-c)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(snappy-c)$/; }' >> 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@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand Down Expand Up @@ -216,8 +233,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
1 change: 1 addition & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
branches: main
copy-fields: all
apt: libsnappy-dev
12 changes: 7 additions & 5 deletions snappy-c.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ tested-with: GHC==8.10.7
, GHC==9.4.8
, GHC==9.6.4
, GHC==9.8.2
, GHC==9.10.1
, GHC==9.12.1

source-repository head
type: git
Expand All @@ -34,7 +36,7 @@ common lang
-Wprepositive-qualified-module
-Widentities
build-depends:
base >= 4.14 && < 4.21
base >= 4.14 && < 4.22
default-language:
Haskell2010
default-extensions:
Expand Down Expand Up @@ -78,7 +80,7 @@ library
Codec.Compression.SnappyC.Internal.Util
build-depends:
, bytestring >= 0.10 && < 0.13
, data-default >= 0.7 && < 0.8
, data-default >= 0.7 && < 0.9
, digest >= 0.0.2 && < 0.0.3
, mtl >= 2.2.2 && < 2.4
extra-libraries:
Expand All @@ -96,7 +98,7 @@ executable snappy-cli

, bytestring >= 0.10 && < 0.13
, conduit >= 1.3.5 && < 1.4
, data-default >= 0.7 && < 0.8
, data-default >= 0.7 && < 0.9
, optparse-applicative >= 0.18 && < 0.19
ghc-options:
-threaded
Expand All @@ -122,7 +124,7 @@ test-suite test-snappy-c
, bytestring >= 0.10 && < 0.13
, tasty >= 1.5 && < 1.6
, tasty-hunit >= 0.10 && < 0.11
, tasty-quickcheck >= 0.10 && < 0.11
, tasty-quickcheck >= 0.10 && < 0.12
ghc-options:
-threaded
-rtsopts
Expand All @@ -142,7 +144,7 @@ benchmark bench-snappy-c
, bytestring >= 0.10 && < 0.13
, criterion >= 1.6.3 && < 1.7
, deepseq >= 1.4 && < 1.6
, random >= 1.2.1 && < 1.3
, random >= 1.2.1 && < 1.4
, snappy-lazy >= 0.1 && < 0.2
, zlib >= 0.6.3 && < 0.8

Expand Down

0 comments on commit a00fe18

Please sign in to comment.