Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GHC 9.10 #27

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
path: ${{ env.CONFER_EXEC_TAR }}

build-alpine:
name: 9.8.2 on alpine-3.19
name: 9.10.1 on alpine-3.19
runs-on: ubuntu-latest
container: 'alpine:3.19'
needs: generate-matrix
Expand All @@ -107,7 +107,7 @@ jobs:
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: '9.8.2'
ghc-version: '9.10.1'
cabal-version: 'latest'

- name: Configure
Expand Down
9 changes: 2 additions & 7 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ packages: ./

active-repositories: hackage.haskell.org

with-compiler: ghc-9.8
with-compiler: ghc-9.10

allow-newer: mtl, ansi-terminal, text, tasty

Expand All @@ -22,12 +22,7 @@ package *
allow-newer:
hslua-aeson:unordered-containers

source-repository-package
type: git
location: https://github.com/ekmett/placeholder
tag: c958c36

source-repository-package
type: git
location: https://github.com/goodlyrottenapple/tasty-test-reporter
tag: b704130
tag: b704130545aa3925a8487bd3e92f1dd5ce0512e2
132 changes: 89 additions & 43 deletions cabal.project.freeze
Original file line number Diff line number Diff line change
@@ -1,57 +1,80 @@
active-repositories: hackage.haskell.org:merge
constraints: any.OneTuple ==0.4.2,
constraints: any.Cabal ==3.14.1.1,
any.Cabal-syntax ==3.14.1.0,
any.OneTuple ==0.4.2,
any.QuickCheck ==2.15.0.1,
QuickCheck -old-random +templatehaskell,
any.StateVar ==1.2.2,
any.aeson ==2.2.2.0,
any.aeson ==2.2.3.0,
aeson +ordered-keymap,
any.ansi-terminal ==1.1.1,
any.alex ==3.5.2.0,
any.ansi-terminal ==1.1.2,
ansi-terminal -example,
any.ansi-terminal-types ==1.1,
any.array ==0.5.6.0,
any.array ==0.5.7.0,
any.assoc ==1.1.1,
assoc -tagged,
any.async ==2.2.5,
async -bench,
any.base ==4.19.1.0,
any.base-orphans ==0.9.2,
any.attoparsec ==0.14.4,
attoparsec -developer,
any.base ==4.20.0.0,
any.base-orphans ==0.9.3,
any.bifunctors ==5.6.2,
bifunctors +tagged,
any.binary ==0.8.9.1,
any.binary ==0.8.9.3,
any.bitvec ==1.1.5.0,
bitvec +simd,
any.blaze-builder ==0.4.2.3,
any.blaze-html ==0.9.2.0,
any.blaze-markup ==0.8.3.0,
any.bytestring ==0.12.1.0,
any.cabal-doctest ==1.0.11,
any.call-stack ==0.4.0,
any.character-ps ==0.1,
any.clock ==0.8.4,
clock -llvm,
any.colour ==2.3.6,
any.comonad ==5.0.8,
any.comonad ==5.0.9,
comonad +containers +distributive +indexed-traversable,
any.concurrent-output ==1.10.21,
any.conduit ==1.3.6,
any.conduit-extra ==1.3.7,
confer +development,
any.containers ==0.6.8,
any.contravariant ==1.5.5,
contravariant +semigroups +statevar +tagged,
any.data-fix ==0.3.3,
any.data-default ==0.8.0.0,
any.data-fix ==0.3.4,
any.deepseq ==1.5.0.0,
any.directory ==1.3.8.1,
any.directory ==1.3.9.0,
directory -os-string,
any.distributive ==0.6.2.1,
distributive +semigroups +tagged,
any.dlist ==1.0,
dlist -werror,
any.effectful ==2.3.1.0,
any.effectful ==2.5.1.0,
effectful -benchmark-foreign-libraries,
any.effectful-core ==2.3.1.0,
any.effectful-core ==2.5.1.0,
any.exceptions ==0.10.7,
any.extra ==1.7.16,
any.filepath ==1.4.200.1,
any.extra ==1.8,
any.file-embed ==0.0.16.0,
any.file-io ==0.1.5,
file-io -os-string,
any.filepath ==1.4.301.0,
filepath -cpphs,
any.generically ==0.1.1,
any.ghc-bignum ==1.3,
any.ghc-boot-th ==9.8.2,
any.ghc-boot-th ==9.10.1,
any.ghc-internal ==9.1001.0,
any.ghc-prim ==0.11.0,
any.hashable ==1.4.4.0,
hashable +integer-gmp -random-initial-seed,
any.hashable ==1.5.0.0,
hashable -arch-native -random-initial-seed,
any.hostname ==1.0,
any.hpc ==0.7.0.0,
any.hslua-aeson ==2.3.1,
any.hpc ==0.7.0.2,
any.hsc2hs ==0.68.10,
hsc2hs -in-ghc-tree,
any.hslua-aeson ==2.3.1.1,
any.hslua-core ==2.3.2,
any.hslua-marshalling ==2.3.1,
any.hslua-module-system ==1.1.2,
Expand All @@ -61,25 +84,30 @@ constraints: any.OneTuple ==0.4.2,
any.indexed-traversable ==0.1.4,
any.indexed-traversable-instances ==0.1.2,
any.integer-conversion ==0.1.1,
any.integer-logarithms ==1.0.3.1,
any.integer-logarithms ==1.0.4,
integer-logarithms -check-bounds +integer-gmp,
any.lua ==2.3.2,
any.junit-xml ==0.1.0.4,
any.lua ==2.3.3,
lua +allow-unsafe-gc -apicheck -cross-compile +export-dynamic -lua_32bits -pkg-config -system-lua,
any.monad-control ==1.0.3.1,
any.mono-traversable ==1.0.21.0,
any.mtl ==2.3.1,
any.network ==3.2.7.0,
network -devel,
any.network-uri ==2.6.4.2,
any.optparse-applicative ==0.18.1.0,
optparse-applicative +process,
any.os-string ==2.0.3,
any.parsec ==3.1.17.0,
any.placeholder ==0,
any.os-string ==2.0.2,
any.parsec ==3.1.18.0,
any.pretty ==1.1.3.6,
any.prettyprinter ==1.7.1,
prettyprinter -buildreadme +text,
any.prettyprinter-ansi-terminal ==1.1.3,
any.primitive ==0.9.0.0,
any.process ==1.6.18.0,
any.random ==1.2.1.2,
any.process ==1.6.25.0,
any.quote-quot ==0.2.1.0,
any.random ==1.2.1.3,
any.resourcet ==1.3.0,
any.rts ==1.0.2,
any.safe-exceptions ==0.1.7.4,
any.scientific ==0.3.8.0,
Expand All @@ -89,42 +117,60 @@ constraints: any.OneTuple ==0.4.2,
semialign +semigroupoids,
any.semigroupoids ==6.0.1,
semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers,
any.splitmix ==0.1.0.5,
any.split ==0.2.5,
any.splitmix ==0.1.1,
splitmix -optimised-mixer,
any.stm ==2.5.2.1,
any.strict ==0.5,
any.tagged ==0.8.8,
any.stm ==2.5.3.1,
any.streaming-commons ==0.2.3.0,
streaming-commons -use-bytestring-builder,
any.strict ==0.5.1,
any.strict-mutable-base ==1.1.0.0,
any.system-cxx-std-lib ==1.0,
any.tagged ==0.8.9,
tagged +deepseq +transformers,
any.tasty ==1.5,
any.tasty ==1.5.3,
tasty +unix,
any.tasty-coverage ==0.1.3.0,
any.tasty-hunit ==0.10.1,
any.template-haskell ==2.21.0.0,
any.tasty-coverage ==0.1.4.0,
any.tasty-hunit ==0.10.2,
any.tasty-test-reporter ==0.1.1.4,
any.template-haskell ==2.22.0.0,
any.temporary ==1.3,
any.text ==2.1.1,
any.text-display ==0.0.5.2,
any.terminal-size ==0.3.4,
any.text ==2.1.2,
text -developer -extendedbenchmarks -pure-haskell +simdutf,
any.text-builder-linear ==0.1.3,
any.text-display ==1.0.0.0,
text-display -book,
any.text-iso8601 ==0.1.1,
any.text-short ==0.1.6,
text-short -asserts,
any.th-abstraction ==0.7.0.0,
any.th-compat ==0.1.5,
any.th-abstraction ==0.7.1.0,
any.th-compat ==0.1.6,
any.these ==1.2.1,
any.time ==1.12.2,
any.time-compat ==1.9.7,
any.transformers ==0.6.1.0,
any.time-compat ==1.9.8,
any.transformers ==0.6.1.1,
any.transformers-base ==0.4.6,
transformers-base +orphaninstances,
any.transformers-compat ==0.7.2,
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
any.unix ==2.8.4.0,
any.typed-process ==0.2.12.0,
any.unix ==2.8.6.0,
unix -os-string,
any.unliftio ==0.2.25.0,
any.unliftio-core ==0.2.1.0,
any.unordered-containers ==0.2.20,
unordered-containers -debug,
any.uuid-types ==1.0.6,
any.validation-selective ==0.2.0.0,
any.vector ==0.13.1.0,
any.vector ==0.13.2.0,
vector +boundschecks -internalchecks -unsafechecks -wall,
any.vector-algorithms ==0.9.0.3,
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
any.vector-stream ==0.1.0.1,
any.witherable ==0.5
any.witherable ==0.5,
any.xml-conduit ==1.10.0.0,
any.xml-types ==0.3.8,
any.zlib ==0.7.1.0,
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
index-state: hackage.haskell.org 2025-02-04T12:11:13Z
13 changes: 4 additions & 9 deletions confer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ build-type: Simple
extra-doc-files:
CHANGELOG.md
doc/*.md
examples/confer.lua
README.md
doc/confer_example.lua

data-files: runtime/lua/confer.lua
tested-with: GHC ==9.8.2
tested-with: GHC ==9.10.1

flag development
description: Compile the project for development
Expand Down Expand Up @@ -91,16 +91,13 @@ library
, hslua-marshalling
, hslua-module-system
, hslua-packaging
, placeholder
, selective
, text
, text-builder-linear
, text-display
, validation-selective
, vector

if flag(development)
build-depends: placeholder

hs-source-dirs: src

executable confer
Expand All @@ -121,9 +118,6 @@ executable confer
, optparse-applicative
, text

if flag(development)
build-depends: placeholder

test-suite confer-test
import: extensions
import: ghc-options
Expand All @@ -150,3 +144,4 @@ test-suite confer-test
, tasty-hunit
, tasty-test-reporter
, temporary
, vector
File renamed without changes.
7 changes: 4 additions & 3 deletions src/Confer/Config/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
) where

import Data.Maybe
import Data.String
import Data.Text (Text)
import Data.Text.Builder.Linear qualified as Builder
import Data.Text.Display
import Data.Text.Internal.Builder qualified as Builder
import Data.Vector (Vector)
import System.OsPath (OsPath)
import System.OsPath qualified as OsPath

import GHC.Generics

Check warning on line 19 in src/Confer/Config/Types.hs

View workflow job for this annotation

GitHub Actions / 9.10.1 on alpine-3.19

The import of ‘GHC.Generics’ is redundant

Check warning on line 19 in src/Confer/Config/Types.hs

View workflow job for this annotation

GitHub Actions / 9.10.1 on macos-latest

The import of ‘GHC.Generics’ is redundant

Check warning on line 19 in src/Confer/Config/Types.hs

View workflow job for this annotation

GitHub Actions / 9.10.1 on ubuntu-latest

The import of ‘GHC.Generics’ is redundant

data Fact = Fact
{ name :: Text
Expand All @@ -28,9 +29,9 @@
displayBuilder Fact{name, source, destination} =
Builder.fromText name
<> ": "
<> Builder.fromString (fromJust (OsPath.decodeUtf source))
<> fromString (fromJust (OsPath.decodeUtf source))
<> " ~> "
<> Builder.fromString (fromJust (OsPath.decodeUtf destination))
<> fromString (fromJust (OsPath.decodeUtf destination))

data Deployment = Deployment
{ hostname :: Maybe Text
Expand Down
34 changes: 34 additions & 0 deletions test/Confer/EvaluatorTest.hs
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
module Confer.EvaluatorTest where

import Control.Monad
import Data.Function
import Data.List.NonEmpty qualified as NE
import Data.Vector qualified as Vector
import Effectful
import Effectful.Error.Static (Error)
import Effectful.Error.Static qualified as Error
import Effectful.FileSystem
import Effectful.FileSystem qualified as FileSystem
import System.FilePath qualified as FilePath
import System.IO.Temp qualified as Temporary
import System.OsPath
import System.OsPath qualified as OsPath
import Test.Tasty (TestTree)
import Test.Tasty.HUnit ()

import Confer.Config.Evaluator
import Utils

spec :: TestEff TestTree
spec =
testThese
"Evaluator Checks"
[ testThis "Empty configuration" testEmptyConfigurationoError
]

testEmptyConfigurationoError :: TestEff ()
testEmptyConfigurationoError = do
Temporary.withSystemTempDirectory "empty-config.ext" $ \directory -> do
copyFile "./test/fixtures/empty-config.lua" (directory <> "/empty-config.lua")
filepath <- liftIO $ encodeUtf $ directory <> "/empty-config.lua"
result <- assertRight =<< loadConfiguration False filepath
assertEqual result Vector.empty
2 changes: 2 additions & 0 deletions test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Test.Tasty.HUnit
import Test.Tasty.Runners.Reporter qualified as Reporter

import Confer.CLI.Cmd.CheckTest qualified as CheckTest
import Confer.EvaluatorTest qualified as EvaluatorTest
import Utils (TestEff)
import Utils qualified

Expand All @@ -23,4 +24,5 @@ main = do
specs :: List (TestEff TestTree)
specs =
[ CheckTest.spec
, EvaluatorTest.spec
]
5 changes: 4 additions & 1 deletion test/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ assertIsNotSymlink (Right _) = assertFailure "Did not return Left"
assertIsNotSymlink (Left (IsNotSymlink{})) = pure ()
assertIsNotSymlink (Left e) = assertFailure $ "Returned: " <> show e

assertRight :: HasCallStack => Either a () -> TestEff ()
assertRight :: HasCallStack => Either a b -> TestEff b
assertRight (Left _a) = liftIO $ Test.assertFailure "Test return Left instead of Right"
assertRight (Right b) = pure b

Expand All @@ -67,3 +67,6 @@ testThese groupName tests = fmap (Test.testGroup groupName) newTests

assertBool :: Bool -> TestEff ()
assertBool boolean = liftIO $ Test.assertBool "" boolean

assertEqual :: (Eq a, Show a) => a -> a -> TestEff ()
assertEqual actual expected = liftIO $ Test.assertEqual "" actual expected
1 change: 1 addition & 0 deletions test/fixtures/empty-config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return {}
Loading