From 24b55f6963083de4dbde777be61636517e39b7b3 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Wed, 30 Mar 2022 15:11:34 -0400 Subject: [PATCH] Extend GHCs tested on CI This required some hackery in package.yaml to configure warnings and dependencies across versions, but not much in the actual code (e.g. CPP), so that's good. --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++-- graphula.cabal | 28 ++++++++++------- package.yaml | 45 +++++++++++++++++----------- src/Graphula.hs | 1 - src/Graphula/Class.hs | 1 - src/Graphula/Dependencies.hs | 1 - src/Graphula/Dependencies/Generic.hs | 1 - src/Graphula/Idempotent.hs | 2 -- src/Graphula/Logged.hs | 1 - src/Graphula/Node.hs | 1 - stack-lts-12.26.yaml | 5 ++++ stack-lts-12.26.yaml.lock | 12 ++++++++ stack-lts-14.27.yaml | 5 ++++ stack-lts-14.27.yaml.lock | 12 ++++++++ stack-lts-16.31.yaml | 7 +++++ stack-lts-16.31.yaml.lock | 19 ++++++++++++ stack-lts-18.28.yaml | 1 + stack-lts-18.28.yaml.lock | 12 ++++++++ stack.yaml | 5 +--- stack.yaml.lock | 17 ++++------- test/README.lhs | 1 - 21 files changed, 161 insertions(+), 56 deletions(-) create mode 100644 stack-lts-12.26.yaml create mode 100644 stack-lts-12.26.yaml.lock create mode 100644 stack-lts-14.27.yaml create mode 100644 stack-lts-14.27.yaml.lock create mode 100644 stack-lts-16.31.yaml create mode 100644 stack-lts-16.31.yaml.lock create mode 100644 stack-lts-18.28.yaml create mode 100644 stack-lts-18.28.yaml.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e16da7..cfb2477 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,43 @@ on: jobs: test: runs-on: ubuntu-latest + + strategy: + matrix: + stack-yaml: + - stack.yaml # ghc-9.0 + - stack-lts-18.28.yaml # ghc-8.10 + - stack-lts-16.31.yaml # ghc-8.8 + - stack-lts-14.27.yaml # ghc-8.6 + - stack-lts-12.26.yaml # ghc-8.4 + fail-fast: false + + steps: + - uses: actions/checkout@v2 + - uses: freckle/stack-cache-action@v2 + with: + stack-yaml: ${{ matrix.stack-yaml }} + - uses: freckle/stack-action@v3 + with: + stack-yaml: ${{ matrix.stack-yaml }} + + lint: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: freckle/stack-cache-action@v1 - - uses: freckle/stack-action@main + - uses: rwe/actions-hlint-setup@v1 + - uses: rwe/actions-hlint-run@v2 + with: + fail-on: warning + + nightly: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: freckle/stack-cache-action@v2 + with: + stack-yaml: stack-nightly.yaml + - uses: freckle/stack-action@v3 with: - weeder: false + stack-yaml: stack-nightly.yaml + stack-arguments: --resolver nightly diff --git a/graphula.cabal b/graphula.cabal index a9da220..35fab66 100644 --- a/graphula.cabal +++ b/graphula.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: fbf7a7a0f44dad0ea63d4f70b57442153982e960d839d2ab2c38d9ad0d40114e +-- hash: f07abca9cc4e0e29ae8560a745c8b2cc86944deeb041585db5d70a2aa3fea027 name: graphula version: 2.0.1.0 @@ -25,6 +25,11 @@ source-repository head type: git location: https://github.com/freckle/graphula +flag persistent-template + description: Include dependency on persistent-template + manual: False + default: False + library exposed-modules: Graphula @@ -41,7 +46,7 @@ library Paths_graphula hs-source-dirs: src - ghc-options: -Weverything -Wno-unsafe -Wno-safe -Wno-missing-import-lists -Wno-implicit-prelude + ghc-options: -Weverything -Wno-all-missed-specialisations -Wno-implicit-prelude -Wno-missing-import-lists -Wno-safe -Wno-unsafe build-depends: HUnit , QuickCheck @@ -55,11 +60,12 @@ library , semigroups , temporary , text - , transformers , unliftio , unliftio-core if impl(ghc >= 8.10) ghc-options: -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module + if impl(ghc < 8.6) + ghc-options: -Wno-redundant-constraints default-language: Haskell2010 test-suite readme @@ -69,27 +75,27 @@ test-suite readme Paths_graphula hs-source-dirs: test - ghc-options: -Weverything -Wno-unsafe -Wno-safe -Wno-missing-import-lists -Wno-implicit-prelude -pgmL markdown-unlit + ghc-options: -Weverything -Wno-all-missed-specialisations -Wno-implicit-prelude -Wno-missing-import-lists -Wno-safe -Wno-unsafe -pgmL markdown-unlit build-depends: QuickCheck - , aeson , base <5 - , bytestring - , containers , generic-arbitrary , graphula , hspec - , http-api-data , markdown-unlit , monad-logger - , path-pieces , persistent , persistent-sqlite - , persistent-template , resourcet - , text , transformers , unliftio-core if impl(ghc >= 8.10) ghc-options: -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module + if impl(ghc < 8.6) + ghc-options: -Wno-redundant-constraints + if impl(ghc >= 8.8) + ghc-options: -Wno-missing-deriving-strategies + if flag(persistent-template) + build-depends: + persistent-template default-language: Haskell2010 diff --git a/package.yaml b/package.yaml index fde100d..3b95410 100644 --- a/package.yaml +++ b/package.yaml @@ -12,17 +12,21 @@ extra-source-files: - CHANGELOG.md ghc-options: - -Weverything - -Wno-unsafe - -Wno-safe - -Wno-missing-import-lists - -Wno-implicit-prelude + - -Weverything + - -Wno-all-missed-specialisations + - -Wno-implicit-prelude + - -Wno-missing-import-lists + - -Wno-safe + - -Wno-unsafe when: - condition: impl(ghc >= 8.10) - ghc-options: - -Wno-missing-safe-haskell-mode - -Wno-prepositive-qualified-module + - condition: impl(ghc >= 8.10) + ghc-options: + - -Wno-missing-safe-haskell-mode + - -Wno-prepositive-qualified-module + - condition: impl(ghc < 8.6) + ghc-options: + - -Wno-redundant-constraints dependencies: - base < 5 @@ -42,7 +46,6 @@ library: - semigroups - temporary - text - - transformers - unliftio - unliftio-core @@ -52,22 +55,30 @@ tests: ghc-options: -pgmL markdown-unlit source-dirs: - test + dependencies: - QuickCheck - - aeson - - bytestring - - containers - generic-arbitrary - graphula - hspec - - http-api-data - markdown-unlit - monad-logger - - path-pieces - persistent - persistent-sqlite - - persistent-template - resourcet - - text - transformers - unliftio-core + + when: + - condition: impl(ghc >= 8.8) + ghc-options: + - -Wno-missing-deriving-strategies + - condition: "flag(persistent-template)" + dependencies: + - persistent-template + +flags: + persistent-template: + description: Include dependency on persistent-template + manual: false + default: false diff --git a/src/Graphula.hs b/src/Graphula.hs index 901e48d..46b3c49 100755 --- a/src/Graphula.hs +++ b/src/Graphula.hs @@ -9,7 +9,6 @@ {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} diff --git a/src/Graphula/Class.hs b/src/Graphula/Class.hs index 62c22d2..d84b6d0 100644 --- a/src/Graphula/Class.hs +++ b/src/Graphula/Class.hs @@ -4,7 +4,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} diff --git a/src/Graphula/Dependencies.hs b/src/Graphula/Dependencies.hs index 1d0d5b9..a5afe6a 100644 --- a/src/Graphula/Dependencies.hs +++ b/src/Graphula/Dependencies.hs @@ -9,7 +9,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/src/Graphula/Dependencies/Generic.hs b/src/Graphula/Dependencies/Generic.hs index b2e7b46..c326def 100644 --- a/src/Graphula/Dependencies/Generic.hs +++ b/src/Graphula/Dependencies/Generic.hs @@ -4,7 +4,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} diff --git a/src/Graphula/Idempotent.hs b/src/Graphula/Idempotent.hs index 68789ae..ed8c295 100644 --- a/src/Graphula/Idempotent.hs +++ b/src/Graphula/Idempotent.hs @@ -8,8 +8,6 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoStarIsType #-} -{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/src/Graphula/Logged.hs b/src/Graphula/Logged.hs index 21a4cfc..7b7233b 100644 --- a/src/Graphula/Logged.hs +++ b/src/Graphula/Logged.hs @@ -7,7 +7,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} diff --git a/src/Graphula/Node.hs b/src/Graphula/Node.hs index c4d1471..9750cb3 100644 --- a/src/Graphula/Node.hs +++ b/src/Graphula/Node.hs @@ -9,7 +9,6 @@ {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} diff --git a/stack-lts-12.26.yaml b/stack-lts-12.26.yaml new file mode 100644 index 0000000..5deda7b --- /dev/null +++ b/stack-lts-12.26.yaml @@ -0,0 +1,5 @@ +resolver: lts-12.26 + +flags: + graphula: + persistent-template: true diff --git a/stack-lts-12.26.yaml.lock b/stack-lts-12.26.yaml.lock new file mode 100644 index 0000000..6bee1e8 --- /dev/null +++ b/stack-lts-12.26.yaml.lock @@ -0,0 +1,12 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: [] +snapshots: +- completed: + size: 509471 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/12/26.yaml + sha256: 95f014df58d0679b1c4a2b7bf2b652b61da8d30de5f571abb0d59015ef678646 + original: lts-12.26 diff --git a/stack-lts-14.27.yaml b/stack-lts-14.27.yaml new file mode 100644 index 0000000..f476404 --- /dev/null +++ b/stack-lts-14.27.yaml @@ -0,0 +1,5 @@ +resolver: lts-14.27 + +flags: + graphula: + persistent-template: true diff --git a/stack-lts-14.27.yaml.lock b/stack-lts-14.27.yaml.lock new file mode 100644 index 0000000..e24dcac --- /dev/null +++ b/stack-lts-14.27.yaml.lock @@ -0,0 +1,12 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: [] +snapshots: +- completed: + size: 524996 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/27.yaml + sha256: 7ea31a280c56bf36ff591a7397cc384d0dff622e7f9e4225b47d8980f019a0f0 + original: lts-14.27 diff --git a/stack-lts-16.31.yaml b/stack-lts-16.31.yaml new file mode 100644 index 0000000..bbad91c --- /dev/null +++ b/stack-lts-16.31.yaml @@ -0,0 +1,7 @@ +resolver: lts-16.31 +extra-deps: + - generics-eot-0.4.0.1 + +flags: + graphula: + persistent-template: true diff --git a/stack-lts-16.31.yaml.lock b/stack-lts-16.31.yaml.lock new file mode 100644 index 0000000..9e65068 --- /dev/null +++ b/stack-lts-16.31.yaml.lock @@ -0,0 +1,19 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + hackage: generics-eot-0.4.0.1@sha256:3d8df1d8ca010238ec5f20ba30282daa0fac99c7de495fae64e26a7ea1dadb08,2312 + pantry-tree: + size: 1384 + sha256: 0895826ac5485a85e6fa37ae2b76195872fa2d92e901478c42d0690fc206a5ab + original: + hackage: generics-eot-0.4.0.1 +snapshots: +- completed: + size: 534126 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/31.yaml + sha256: 637fb77049b25560622a224845b7acfe81a09fdb6a96a3c75997a10b651667f6 + original: lts-16.31 diff --git a/stack-lts-18.28.yaml b/stack-lts-18.28.yaml new file mode 100644 index 0000000..773d5c9 --- /dev/null +++ b/stack-lts-18.28.yaml @@ -0,0 +1 @@ +resolver: lts-18.28 diff --git a/stack-lts-18.28.yaml.lock b/stack-lts-18.28.yaml.lock new file mode 100644 index 0000000..7af0442 --- /dev/null +++ b/stack-lts-18.28.yaml.lock @@ -0,0 +1,12 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: [] +snapshots: +- completed: + size: 590100 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/28.yaml + sha256: 428ec8d5ce932190d3cbe266b9eb3c175cd81e984babf876b64019e2cbe4ea68 + original: lts-18.28 diff --git a/stack.yaml b/stack.yaml index dcb2e41..cb1396f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,7 +1,4 @@ -resolver: lts-17.8 - -extra-deps: - - generics-eot-0.4.0.1@sha256:3d8df1d8ca010238ec5f20ba30282daa0fac99c7de495fae64e26a7ea1dadb08,2312 +resolver: lts-19.1 ghc-options: "$locals": -fwrite-ide-info diff --git a/stack.yaml.lock b/stack.yaml.lock index 9c7d4f7..365f070 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -3,17 +3,10 @@ # For more information, please see the documentation at: # https://docs.haskellstack.org/en/stable/lock_files -packages: -- completed: - hackage: generics-eot-0.4.0.1@sha256:3d8df1d8ca010238ec5f20ba30282daa0fac99c7de495fae64e26a7ea1dadb08,2312 - pantry-tree: - size: 1384 - sha256: 0895826ac5485a85e6fa37ae2b76195872fa2d92e901478c42d0690fc206a5ab - original: - hackage: generics-eot-0.4.0.1@sha256:3d8df1d8ca010238ec5f20ba30282daa0fac99c7de495fae64e26a7ea1dadb08,2312 +packages: [] snapshots: - completed: - size: 565720 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/17/8.yaml - sha256: 76bf8992ff8dfe6eda9c02f81866138c2369344d5011ab39ae403457c4448b03 - original: lts-17.8 + size: 617355 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/1.yaml + sha256: cbd5e8593869445794924668479b5bd9f1738d075898623dceacc13b2576b6e3 + original: lts-19.1 diff --git a/test/README.lhs b/test/README.lhs index 42d19dc..cea35aa 100644 --- a/test/README.lhs +++ b/test/README.lhs @@ -20,7 +20,6 @@ dependencies. We use this interface to generate fixtures for automated testing. {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -fno-warn-missing-deriving-strategies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main (module Main) where