Skip to content

Commit

Permalink
Update CI (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybczak authored Aug 22, 2023
1 parent 4fc18b6 commit f420b0f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 69 deletions.
79 changes: 18 additions & 61 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.15.20230321
# version: 0.17.20230808
#
# REGENDATA ("0.15.20230321",["github","--config=cabal.haskell-ci","cabal.project"])
# REGENDATA ("0.17.20230808",["github","--config=cabal.haskell-ci","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -22,102 +22,60 @@ on:
- master
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }} - Postgres ${{ matrix.postgres-version }}
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
services:
postgres:
image: postgres:${{matrix.postgres-version}}
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.6.1
- compiler: ghc-9.6.2
compilerKind: ghc
compilerVersion: 9.6.1
compilerVersion: 9.6.2
setup-method: ghcup
allow-failure: false
postgres-version: "11"
- compiler: ghc-9.6.1
- compiler: ghc-9.4.6
compilerKind: ghc
compilerVersion: 9.6.1
compilerVersion: 9.4.6
setup-method: ghcup
allow-failure: false
postgres-version: "15"
- compiler: ghc-9.4.4
- compiler: ghc-9.2.8
compilerKind: ghc
compilerVersion: 9.4.4
compilerVersion: 9.2.8
setup-method: ghcup
allow-failure: false
postgres-version: "11"
- compiler: ghc-9.4.4
compilerKind: ghc
compilerVersion: 9.4.4
setup-method: ghcup
allow-failure: false
postgres-version: "15"
- compiler: ghc-9.2.7
compilerKind: ghc
compilerVersion: 9.2.7
setup-method: ghcup
allow-failure: false
postgres-version: "11"
- compiler: ghc-9.2.7
compilerKind: ghc
compilerVersion: 9.2.7
setup-method: ghcup
allow-failure: false
postgres-version: "15"
- compiler: ghc-9.0.2
compilerKind: ghc
compilerVersion: 9.0.2
setup-method: ghcup
allow-failure: false
postgres-version: "11"
- compiler: ghc-9.0.2
compilerKind: ghc
compilerVersion: 9.0.2
setup-method: ghcup
allow-failure: false
postgres-version: "15"
- compiler: ghc-8.10.7
compilerKind: ghc
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
postgres-version: "11"
- compiler: ghc-8.10.7
compilerKind: ghc
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
postgres-version: "15"
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: ghcup
allow-failure: false
postgres-version: "11"
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: ghcup
allow-failure: false
postgres-version: "15"
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
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"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$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)
Expand All @@ -132,10 +90,12 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$HOME/.ghcup/bin/$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=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$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"
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"
Expand Down Expand Up @@ -186,8 +146,8 @@ jobs:
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
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
Expand Down Expand Up @@ -220,9 +180,6 @@ jobs:
echo "package hpqtypes-extras" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: *:base
allow-newer: *:ghc-prim
allow-newer: *:template-haskell
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(hpqtypes-extras)$/; }' >> cabal.project.local
cat cabal.project
Expand Down
2 changes: 0 additions & 2 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ doctest: False
tests: True
postgresql: True

postgresql-versions: 11 15

ghcup-jobs: True
5 changes: 0 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
packages: .

-- GHC 9.6
allow-newer: *:base
, *:ghc-prim
, *:template-haskell
2 changes: 1 addition & 1 deletion hpqtypes-extras.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ maintainer: Andrzej Rybczak <andrzej@rybczak.net>,
copyright: Scrive AB
category: Database
build-type: Simple
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.4 || ==9.6.1
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.6 || ==9.6.2

Source-repository head
Type: git
Expand Down

0 comments on commit f420b0f

Please sign in to comment.