diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2025-11-13 23:23:08 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-11-13 23:23:08 +0100 |
| commit | 00e5bc0f9874eb9f929e917ba44bbd7b6f2ca4a8 (patch) | |
| tree | fbfdb065ed90bbbf65dcbe3c41e9042d46ae15cf /src/Config.hs | |
| parent | d6ff11543a3897dd2b38ed121f958ef0050e272c (diff) | |
Do not require recipe and empty checkout in job definition
Diffstat (limited to 'src/Config.hs')
| -rw-r--r-- | src/Config.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Config.hs b/src/Config.hs index d643f27..22bc89a 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -85,15 +85,18 @@ parseJob :: Text -> Node Pos -> Parser DeclaredJob parseJob name node = flip (withMap "Job") node $ \j -> do let jobName = JobName name jobId = jobName + jobRecipe <- choice + [ fmap Just $ cabalJob =<< j .: "cabal" + , fmap Just $ shellJob =<< j .: "shell" + , return Nothing + ] jobCheckout <- choice [ parseSingleCheckout =<< j .: "checkout" , parseMultipleCheckouts =<< j .: "checkout" , withNull "no checkout" (return []) =<< j .: "checkout" - , return [ JobCheckout Nothing Nothing Nothing ] - ] - jobRecipe <- choice - [ cabalJob =<< j .: "cabal" - , shellJob =<< j .: "shell" + , return $ if isJust jobRecipe + then [ JobCheckout Nothing Nothing Nothing ] + else [] ] jobArtifacts <- parseArtifacts j jobUses <- maybe (return []) parseUses =<< j .:? "uses" |