Get building on nightly with ghc 8
This commit is contained in:
parent
6edd459223
commit
399463f8c5
@ -47,8 +47,7 @@ matrix:
|
|||||||
- hvr-ghc
|
- hvr-ghc
|
||||||
packages:
|
packages:
|
||||||
- ghc-head
|
- ghc-head
|
||||||
allow_failures:
|
- env: GHCVER=head RESOLVER=nightly EXTRADEPS="" STACKARGS="--stack-yaml=stack_nightly.yaml"
|
||||||
- env: GHCVER=head RESOLVER=nightly EXTRADEPS="" STACKARGS=""
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# Download and unpack the stack executable
|
# Download and unpack the stack executable
|
||||||
|
|||||||
@ -126,7 +126,7 @@ getApplicationDev = do
|
|||||||
return (wsettings, app)
|
return (wsettings, app)
|
||||||
|
|
||||||
getAppSettings :: IO AppSettings
|
getAppSettings :: IO AppSettings
|
||||||
getAppSettings = loadAppSettings [configSettingsYml] [] useEnv
|
getAppSettings = loadYamlSettings [configSettingsYml] [] useEnv
|
||||||
|
|
||||||
-- | main function for use by yesod devel
|
-- | main function for use by yesod devel
|
||||||
develMain :: IO ()
|
develMain :: IO ()
|
||||||
@ -136,7 +136,7 @@ develMain = develMainHelper getApplicationDev
|
|||||||
appMain :: IO ()
|
appMain :: IO ()
|
||||||
appMain = do
|
appMain = do
|
||||||
-- Get the settings from all relevant sources
|
-- Get the settings from all relevant sources
|
||||||
settings <- loadAppSettingsArgs
|
settings <- loadYamlSettingsArgs
|
||||||
-- fall back to compile-time values, set to [] to require values at runtime
|
-- fall back to compile-time values, set to [] to require values at runtime
|
||||||
[configSettingsYmlValue]
|
[configSettingsYmlValue]
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import Text.Hamlet (hamletFile)
|
|||||||
import Text.Jasmine (minifym)
|
import Text.Jasmine (minifym)
|
||||||
import Web.ServerSession.Backend.Persistent
|
import Web.ServerSession.Backend.Persistent
|
||||||
import Web.ServerSession.Frontend.Yesod
|
import Web.ServerSession.Frontend.Yesod
|
||||||
import Yesod.Auth.BrowserId (authBrowserId)
|
import Yesod.Auth.Dummy (authDummy)
|
||||||
import Yesod.Default.Util (addStaticContentExternal)
|
import Yesod.Default.Util (addStaticContentExternal)
|
||||||
import Yesod.Core.Types (Logger)
|
import Yesod.Core.Types (Logger)
|
||||||
import qualified Yesod.Core.Unsafe as Unsafe
|
import qualified Yesod.Core.Unsafe as Unsafe
|
||||||
@ -140,7 +140,7 @@ instance YesodAuth App where
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- You can add other plugins like BrowserID, email or OAuth here
|
-- You can add other plugins like BrowserID, email or OAuth here
|
||||||
authPlugins _ = [authBrowserId def]
|
authPlugins _ = [authDummy]
|
||||||
|
|
||||||
authHttpManager = getHttpManager
|
authHttpManager = getHttpManager
|
||||||
|
|
||||||
|
|||||||
@ -24,12 +24,12 @@ getHomeR = do
|
|||||||
-- | Invalidate the session as requested via 'forceForm'.
|
-- | Invalidate the session as requested via 'forceForm'.
|
||||||
postForceR :: Handler ()
|
postForceR :: Handler ()
|
||||||
postForceR =
|
postForceR =
|
||||||
processForm "Force form" forceForm $ \force -> do
|
processForm "Force form" forceForm $ \frce -> do
|
||||||
msid <- getSessionId
|
msid <- getSessionId
|
||||||
SS.forceInvalidate force
|
SS.forceInvalidate frce
|
||||||
return $ concat
|
return $ concat
|
||||||
[ "Forced session invalidation using "
|
[ "Forced session invalidation using "
|
||||||
, show force
|
, show frce
|
||||||
, " [old session ID was "
|
, " [old session ID was "
|
||||||
, show msid
|
, show msid
|
||||||
, "]." ]
|
, "]." ]
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
module Settings where
|
module Settings where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
import ClassyPrelude.Yesod
|
||||||
import Control.Exception (throw)
|
import Control.Exception as E
|
||||||
import Data.Aeson (Result (..), fromJSON, withObject, (.!=),
|
import Data.Aeson (Result (..), fromJSON, withObject, (.!=),
|
||||||
(.:?))
|
(.:?))
|
||||||
import Data.FileEmbed (embedFile)
|
import Data.FileEmbed (embedFile)
|
||||||
@ -108,7 +108,7 @@ configSettingsYmlBS = $(embedFile configSettingsYml)
|
|||||||
|
|
||||||
-- | @config/settings.yml@, parsed to a @Value@.
|
-- | @config/settings.yml@, parsed to a @Value@.
|
||||||
configSettingsYmlValue :: Value
|
configSettingsYmlValue :: Value
|
||||||
configSettingsYmlValue = either throw id $ decodeEither' configSettingsYmlBS
|
configSettingsYmlValue = either E.throw id $ decodeEither' configSettingsYmlBS
|
||||||
|
|
||||||
-- | A version of @AppSettings@ parsed at compile time from @config/settings.yml@.
|
-- | A version of @AppSettings@ parsed at compile time from @config/settings.yml@.
|
||||||
compileTimeAppSettings :: AppSettings
|
compileTimeAppSettings :: AppSettings
|
||||||
|
|||||||
@ -3,15 +3,15 @@ module Handler.CommonSpec (spec) where
|
|||||||
import TestImport
|
import TestImport
|
||||||
|
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec = withApp $ do
|
spec = yesodSpecWithSiteGenerator mkApp $ do
|
||||||
describe "robots.txt" $ do
|
ydescribe "robots.txt" $ do
|
||||||
it "gives a 200" $ do
|
yit "gives a 200" $ do
|
||||||
get RobotsR
|
get RobotsR
|
||||||
statusIs 200
|
statusIs 200
|
||||||
it "has correct User-agent" $ do
|
yit "has correct User-agent" $ do
|
||||||
get RobotsR
|
get RobotsR
|
||||||
bodyContains "User-agent: *"
|
bodyContains "User-agent: *"
|
||||||
describe "favicon.ico" $ do
|
ydescribe "favicon.ico" $ do
|
||||||
it "gives a 200" $ do
|
yit "gives a 200" $ do
|
||||||
get FaviconR
|
get FaviconR
|
||||||
statusIs 200
|
statusIs 200
|
||||||
|
|||||||
@ -3,7 +3,7 @@ module Handler.HomeSpec (spec) where
|
|||||||
import TestImport
|
import TestImport
|
||||||
|
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec = withApp $ do
|
spec = yesodSpecWithSiteGenerator mkApp $ do
|
||||||
return ()
|
return ()
|
||||||
{-
|
{-
|
||||||
it "loads the index and checks it looks right" $ do
|
it "loads the index and checks it looks right" $ do
|
||||||
|
|||||||
@ -5,12 +5,12 @@ module TestImport
|
|||||||
|
|
||||||
import Application (makeFoundation)
|
import Application (makeFoundation)
|
||||||
import ClassyPrelude as X
|
import ClassyPrelude as X
|
||||||
import Database.Persist as X hiding (get)
|
import Database.Persist as X hiding (delete, deleteBy, get)
|
||||||
import Database.Persist.Sql (SqlPersistM, SqlBackend, runSqlPersistMPool, rawExecute, rawSql, unSingle, connEscapeName)
|
import Database.Persist.Sql (SqlPersistM, SqlBackend, runSqlPersistMPool, rawExecute, rawSql, unSingle, connEscapeName)
|
||||||
import Foundation as X
|
import Foundation as X hiding (Handler)
|
||||||
import Model as X
|
import Model as X
|
||||||
import Test.Hspec as X
|
import Test.Hspec as X
|
||||||
import Yesod.Default.Config2 (ignoreEnv, loadAppSettings)
|
import Yesod.Default.Config2 (ignoreEnv, loadYamlSettings)
|
||||||
import Yesod.Test as X
|
import Yesod.Test as X
|
||||||
|
|
||||||
-- Wiping the database
|
-- Wiping the database
|
||||||
@ -25,9 +25,9 @@ runDB query = do
|
|||||||
pool <- fmap appConnPool getTestYesod
|
pool <- fmap appConnPool getTestYesod
|
||||||
liftIO $ runSqlPersistMPool query pool
|
liftIO $ runSqlPersistMPool query pool
|
||||||
|
|
||||||
withApp :: SpecWith App -> Spec
|
mkApp :: IO App
|
||||||
withApp = before $ do
|
mkApp = do
|
||||||
settings <- loadAppSettings
|
settings <- loadYamlSettings
|
||||||
["config/test-settings.yml", "config/settings.yml"]
|
["config/test-settings.yml", "config/settings.yml"]
|
||||||
[]
|
[]
|
||||||
ignoreEnv
|
ignoreEnv
|
||||||
@ -48,8 +48,8 @@ wipeDB app = do
|
|||||||
|
|
||||||
-- Aside: SQLite by default *does not enable foreign key checks*
|
-- Aside: SQLite by default *does not enable foreign key checks*
|
||||||
-- (disabling foreign keys is only necessary for those who specifically enable them).
|
-- (disabling foreign keys is only necessary for those who specifically enable them).
|
||||||
let settings = appSettings app
|
let settings = appSettings app
|
||||||
sqliteConn <- rawConnection (sqlDatabase $ appDatabaseConf settings)
|
sqliteConn <- rawConnection (sqlDatabase $ appDatabaseConf settings)
|
||||||
disableForeignKeys sqliteConn
|
disableForeignKeys sqliteConn
|
||||||
|
|
||||||
let logFunc = messageLoggerSource app (appLogger app)
|
let logFunc = messageLoggerSource app (appLogger app)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ library
|
|||||||
, bytestring
|
, bytestring
|
||||||
, cereal >= 0.4
|
, cereal >= 0.4
|
||||||
, path-pieces
|
, path-pieces
|
||||||
, persistent >= 2.1 && < 2.3
|
, persistent >= 2.1
|
||||||
, tagged >= 0.7
|
, tagged >= 0.7
|
||||||
, text
|
, text
|
||||||
, time
|
, time
|
||||||
@ -71,8 +71,8 @@ test-suite tests
|
|||||||
|
|
||||||
, hspec >= 2.1 && < 3
|
, hspec >= 2.1 && < 3
|
||||||
, monad-logger
|
, monad-logger
|
||||||
, persistent-sqlite >= 2.1 && < 2.3
|
, persistent-sqlite >= 2.1
|
||||||
, persistent-postgresql >= 2.1 && < 2.3
|
, persistent-postgresql >= 2.1
|
||||||
, resource-pool
|
, resource-pool
|
||||||
, QuickCheck
|
, QuickCheck
|
||||||
|
|
||||||
|
|||||||
@ -25,8 +25,8 @@ library
|
|||||||
, bytestring
|
, bytestring
|
||||||
, nonce
|
, nonce
|
||||||
, path-pieces
|
, path-pieces
|
||||||
, snap == 0.14.*
|
, snap >= 0.14
|
||||||
, snap-core == 0.9.*
|
, snap-core >= 0.9
|
||||||
, text
|
, text
|
||||||
, time
|
, time
|
||||||
, transformers
|
, transformers
|
||||||
|
|||||||
29
stack_nightly.yaml
Normal file
29
stack_nightly.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
resolver: nightly-2017-02-02
|
||||||
|
packages:
|
||||||
|
- serversession
|
||||||
|
- serversession-backend-acid-state
|
||||||
|
- serversession-backend-persistent
|
||||||
|
- serversession-backend-redis
|
||||||
|
- serversession-frontend-snap
|
||||||
|
- serversession-frontend-wai
|
||||||
|
- serversession-frontend-yesod
|
||||||
|
- examples/serversession-example-yesod-persistent
|
||||||
|
flags:
|
||||||
|
serversession:
|
||||||
|
lib-Werror: true
|
||||||
|
serversession-backend-acid-state:
|
||||||
|
lib-Werror: true
|
||||||
|
serversession-backend-persistent:
|
||||||
|
lib-Werror: true
|
||||||
|
serversession-backend-redis:
|
||||||
|
lib-Werror: true
|
||||||
|
serversession-frontend-snap:
|
||||||
|
lib-Werror: true
|
||||||
|
serversession-frontend-wai:
|
||||||
|
lib-Werror: true
|
||||||
|
serversession-frontend-yesod:
|
||||||
|
lib-Werror: true
|
||||||
|
extra-deps:
|
||||||
|
- snap-1.0.0.1
|
||||||
|
- heist-1.0.1.0
|
||||||
|
- map-syntax-0.2.0.2
|
||||||
Loading…
Reference in New Issue
Block a user