From 7d090bd3b72ad11f104021c0c714133a3abdd1a6 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 21 Jan 2024 21:08:23 +0100 Subject: [PATCH 1/2] Build with GHC 9.8 --- hasql-dynamic-statements.cabal | 2 +- library/Hasql/DynamicStatements/Prelude.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hasql-dynamic-statements.cabal b/hasql-dynamic-statements.cabal index ec85d60..eb46533 100644 --- a/hasql-dynamic-statements.cabal +++ b/hasql-dynamic-statements.cabal @@ -34,7 +34,7 @@ library Hasql.DynamicStatements.Snippet.Defs build-depends: base >=4.12 && <5, - bytestring >=0.10 && <0.12, + bytestring >=0.10 && <0.13, containers >=0.6 && <0.7, hasql >=1.6 && <1.7, hasql-implicits >=0.1 && <0.2, diff --git a/library/Hasql/DynamicStatements/Prelude.hs b/library/Hasql/DynamicStatements/Prelude.hs index 7fa7269..aa43f17 100644 --- a/library/Hasql/DynamicStatements/Prelude.hs +++ b/library/Hasql/DynamicStatements/Prelude.hs @@ -28,7 +28,7 @@ import Data.Either as Exports import Data.Fixed as Exports import Data.Foldable as Exports hiding (toList) import Data.Function as Exports hiding (id, (.)) -import Data.Functor as Exports +import Data.Functor as Exports hiding (unzip) import Data.Functor.Contravariant as Exports import Data.Functor.Identity as Exports import Data.Int as Exports From 2abb6d4d2cd823fa1889529d1b3ca21af2b4beef Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 21 Jan 2024 21:08:32 +0100 Subject: [PATCH 2/2] Modernize CI --- .github/workflows/check.yaml | 45 +++++++++++++++++++ .../workflows/on-push-to-master-or-pr.yaml | 17 +++++++ .github/workflows/on-push-to-release.yaml | 32 +++++++++++++ cabal.project | 1 + test/Main.hs | 2 +- 5 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check.yaml create mode 100644 .github/workflows/on-push-to-master-or-pr.yaml create mode 100644 .github/workflows/on-push-to-release.yaml create mode 100644 cabal.project diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..86fb7a2 --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,45 @@ +name: Compile, test and check the docs + +on: + workflow_call: + +jobs: + + check: + + strategy: + fail-fast: false + matrix: + include: + - ghc: 8.8.1 + ghc-options: "" + ignore-haddock: true + ignore-cabal-check: true + - ghc: latest + ignore-cabal-check: true + + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + + - uses: nikita-volkov/build-and-test-cabal-package.github-action@v1 + with: + ghc: ${{matrix.ghc}} + ghc-options: ${{matrix.ghc-options}} + ignore-haddock: ${{matrix.ignore-haddock}} + ignore-cabal-check: ${{matrix.ignore-cabal-check}} diff --git a/.github/workflows/on-push-to-master-or-pr.yaml b/.github/workflows/on-push-to-master-or-pr.yaml new file mode 100644 index 0000000..79c21f5 --- /dev/null +++ b/.github/workflows/on-push-to-master-or-pr.yaml @@ -0,0 +1,17 @@ +name: Compile, test and check the docs + +on: + push: + branches: + - master + pull_request: + +jobs: + + format: + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/format.yaml@v2 + secrets: inherit + + check: + uses: ./.github/workflows/check.yaml + secrets: inherit diff --git a/.github/workflows/on-push-to-release.yaml b/.github/workflows/on-push-to-release.yaml new file mode 100644 index 0000000..204c41a --- /dev/null +++ b/.github/workflows/on-push-to-release.yaml @@ -0,0 +1,32 @@ +name: Release the lib to Hackage + +on: + push: + branches: + - supermajor + - major + - minor + - patch + +concurrency: + group: release + cancel-in-progress: false + +jobs: + + format: + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/format.yaml@v2 + secrets: inherit + + check: + uses: ./.github/workflows/check.yaml + secrets: inherit + + release: + needs: + - format + - check + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/release.yaml@v2 + secrets: inherit + with: + prefix-tag-with-v: false diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..e6fdbad --- /dev/null +++ b/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/test/Main.hs b/test/Main.hs index d68225d..35e67db 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -70,7 +70,7 @@ withConnection handler = host = "localhost" port = 5432 user = "postgres" - password = "" + password = "postgres" database = "postgres" use connection = lift $ handler connection