Skip to content

Commit

Permalink
Allow newer dependencies (#114)
Browse files Browse the repository at this point in the history
* Allow newer dependencies

* Update Haskell-CI to 0.18.1

* Update Haskell-CI to 0.19.20240702
  • Loading branch information
ysangkok authored Jul 3, 2024
1 parent 2c8092b commit 1056593
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 52 deletions.
57 changes: 20 additions & 37 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.16.6
# version: 0.19.20240702
#
# REGENDATA ("0.16.6",["github","--config=cabal.haskell-ci","cabal.project"])
# REGENDATA ("0.19.20240702",["github","--config=cabal.haskell-ci","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -27,7 +27,7 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
Expand Down Expand Up @@ -60,29 +60,19 @@ jobs:
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- 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.19.2/x86_64-linux-ghcup-0.1.19.2 > "$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)
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -94,20 +84,13 @@ jobs:
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/$HCKIND-$HCVER
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.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.1.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.12.1.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"
Expand Down Expand Up @@ -164,7 +147,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 @@ -216,15 +199,15 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(servant-swagger-ui|servant-swagger-ui-core|servant-swagger-ui-example|servant-swagger-ui-jensoleg|servant-swagger-ui-redoc)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(servant-swagger-ui|servant-swagger-ui-core|servant-swagger-ui-example|servant-swagger-ui-jensoleg|servant-swagger-ui-redoc)$/; }' >> 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 @@ -292,7 +275,7 @@ jobs:
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' all ; fi
- 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
7 changes: 7 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ packages:
servant-swagger-ui-example/
servant-swagger-ui-jensoleg/
servant-swagger-ui-redoc/

if impl(ghc >= 9.8) && impl(ghc < 9.10)
-- https://github.com/GetShopTV/swagger2/pull/255
allow-newer: swagger2:Cabal
allow-newer: swagger2:base-compat-batteries
allow-newer: swagger2:lens
allow-newer: swagger2:network
6 changes: 3 additions & 3 deletions servant-swagger-ui-core/servant-swagger-ui-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ library
hs-source-dirs: src
ghc-options: -Wall
build-depends:
base >=4.7 && <4.19
base >=4.7 && <4.21
, aeson >=0.8.0.2 && <2.3
, blaze-markup >=0.7.0.2 && <0.9
, bytestring >=0.10.4.0 && <0.12
, bytestring >=0.10.4.0 && <0.13
, http-media >=0.7.1.3 && <0.9
, servant >=0.14 && <0.21
, servant-blaze >=0.8 && <0.10
, servant-server >=0.14 && <0.21
, text >=1.2.3.0 && <2.1
, text >=1.2.3.0 && <2.2
, transformers >=0.3 && <0.7
, transformers-compat >=0.3 && <0.8
, wai-app-static >=3.0.1.1 && <3.2
Expand Down
6 changes: 3 additions & 3 deletions servant-swagger-ui-example/servant-swagger-ui-example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ executable servant-swagger-ui-example
ghc-options: -threaded
build-depends:
aeson >=0.8.0.2 && <2.3
, base >=4.7 && <4.19
, base-compat >=0.9.3 && <0.14
, lens >=4.7.0.1 && <5.3
, base >=4.7 && <4.21
, base-compat >=0.9.3 && <0.15
, lens >=4.7.0.1 && <5.4
, servant
, servant-server
, servant-swagger
Expand Down
6 changes: 3 additions & 3 deletions servant-swagger-ui-jensoleg/servant-swagger-ui-jensoleg.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ library
ghc-options: -Wall
build-depends: servant-swagger-ui-core >=0.3.5 && <0.4
build-depends:
base >=4.7 && <4.19
base >=4.7 && <4.21
, aeson >=0.8.0.2 && <2.3
, bytestring >=0.10.4.0 && <0.12
, bytestring >=0.10.4.0 && <0.13
, file-embed-lzma >=0 && <0.1
, servant >=0.14 && <0.21
, servant-server >=0.14 && <0.21
, text >=1.2.3.0 && <2.1
, text >=1.2.3.0 && <2.2

exposed-modules: Servant.Swagger.UI.JensOleG
default-language: Haskell2010
6 changes: 3 additions & 3 deletions servant-swagger-ui-redoc/servant-swagger-ui-redoc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ library
ghc-options: -Wall
build-depends: servant-swagger-ui-core >=0.3.5 && <0.4
build-depends:
base >=4.7 && <4.19
base >=4.7 && <4.21
, aeson >=0.8.0.2 && <2.3
, bytestring >=0.10.4.0 && <0.12
, bytestring >=0.10.4.0 && <0.13
, file-embed-lzma >=0 && <0.1
, servant >=0.14 && <0.21
, servant-server >=0.14 && <0.21
, text >=1.2.3.0 && <2.1
, text >=1.2.3.0 && <2.2

exposed-modules: Servant.Swagger.UI.ReDoc
default-language: Haskell2010
6 changes: 3 additions & 3 deletions servant-swagger-ui/servant-swagger-ui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ library
ghc-options: -Wall
build-depends: servant-swagger-ui-core >=0.3.5 && <0.4
build-depends:
base >=4.7 && <4.19
base >=4.7 && <4.21
, aeson >=0.8.0.2 && <2.3
, bytestring >=0.10.4.0 && <0.12
, bytestring >=0.10.4.0 && <0.13
, file-embed-lzma >=0 && <0.1
, servant >=0.14 && <0.21
, servant-server >=0.14 && <0.21
, text >=1.2.3.0 && <2.1
, text >=1.2.3.0 && <2.2

exposed-modules: Servant.Swagger.UI
default-language: Haskell2010

0 comments on commit 1056593

Please sign in to comment.