[CI] add simple .gitlab-ci

Modify app to return exit code when error happened.
parent a242ae85
Pipeline #7464 failed with stage
in 60 minutes and 43 seconds
# Optimising CI speed by using tips from https://blog.nimbleways.com/let-s-make-faster-gitlab-ci-cd-pipelines/
image: cgenie/gargantext:9.6.6
stages:
- test
cabal:
stage: test
script:
- nix --experimental-features 'nix-command flakes' build
- nix --experimental-features 'nix-command flakes' run
allow_failure: false
...@@ -2,12 +2,15 @@ module Main where ...@@ -2,12 +2,15 @@ module Main where
import ISTEX import ISTEX
import ISTEX.Client import ISTEX.Client
import System.Exit
main :: IO () main :: IO ()
main = do main = do
res <- getMetadataWith "artificial intelligence" (Just 10) res <- getMetadataWith "artificial intelligence" (Just 10)
case res of case res of
(Left err) -> print $ "Error: " <> show err (Left err) -> do
print $ "Error: " <> show err
exitWith $ ExitFailure 1
(Right val) -> do (Right val) -> do
print $ take 5 $ _documents_hits val print $ take 5 $ _documents_hits val
-- print $ _abstract <$> (_hits val) -- print $ _abstract <$> (_hits val)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment