Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Nov 11, 2024
1 parent 7db462c commit 96b0868
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
compilerVersion: 9.8.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.3
compilerKind: ghc
compilerVersion: 9.8.3
setup-method: ghcup-vanilla
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
Expand Down Expand Up @@ -112,7 +117,7 @@ jobs:
- name: Install GHC (GHCup vanilla)
if: matrix.setup-method == 'ghcup-vanilla'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
Expand Down
5 changes: 3 additions & 2 deletions src/HaskellCI/Config/History.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ configHistory =
, ver 0 19 20240708 := \cfg -> cfg
& field @"cfgGhcupVersion" .~ C.mkVersion [0,1,30,0]
, ver 0 19 20241111 := \cfg -> cfg
& field @"cfgGhcupJobs" .~ C.intersectVersionRanges ghcupNormalRange (invertVersionRange (C.withinVersion (C.mkVersion [9,8,3])))
& field @"cfgGhcupVanillaJobs" .~ C.withinVersion (C.mkVersion [9,8,3])
& field @"cfgGhcupJobs" .~ C.intersectVersionRanges (C.intersectVersionRanges ghcupNormalRange (C.earlierVersion (C.mkVersion [9,12,0]))) (invertVersionRange (C.withinVersion (C.mkVersion [9,8,3])))
& field @"cfgGhcupVanillaJobs" .~ C.withinVersion (C.mkVersion [9,8,3])
& field @"cfgGhcupPrereleaseJobs" .~ C.orLaterVersion (C.mkVersion [9,12,0])
]
where
ver x y z = [x, y, z]
Expand Down
16 changes: 12 additions & 4 deletions src/HaskellCI/GitHub.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
ghcupGhcEnv

whenWithinGhcRange cfgGhcupVanillaJobs $ githubRunIf' "Install GHC (GHCup vanilla)" "matrix.setup-method == 'ghcup-vanilla'" envEnv $ do
sh $ "\"$HOME/.ghcup/bin/ghcup\" install ghc \"$HCVER\" || (cat \"$HOME\"/.ghcup/logs/*.* && false)"
sh $ "\"$HOME/.ghcup/bin/ghcup\" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc \"$HCVER\" || (cat \"$HOME\"/.ghcup/logs/*.* && false)"
ghcupGhcEnv

whenWithinGhcRange cfgGhcupPrereleaseJobs $ githubRunIf' "Install GHC (GHCup prerelease)" "matrix.setup-method == 'ghcup-prerelease'" envEnv $ do
Expand Down Expand Up @@ -528,19 +528,27 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
, ghjServices = mconcat
[ Map.singleton "postgres" postgresService | cfgPostgres ]
, ghjTimeout = max 10 cfgTimeoutMinutes
, ghjMatrix =
[ GitHubMatrixEntry
, ghjMatrix = concat $
[ [ GitHubMatrixEntry
{ ghmeCompiler = translateCompilerVersion $ compiler
, ghmeAllowFailure =
isGHCHead compiler
|| maybeGHC False (`C.withinRange` cfgAllowFailures) compiler
, ghmeSetupMethod = if isGHCUP compiler then GHCUP else HVRPPA
, ghmeSetupMethod = sp
}
| sp <- [GHCUP, GHCUPvanilla, GHCUPprerelease, HVRPPA]
, compilerWithinGhcRange compiler $ case sp of
GHCUP -> cfgGhcupJobs
GHCUPvanilla -> cfgGhcupVanillaJobs
GHCUPprerelease -> cfgGhcupPrereleaseJobs
HVRPPA -> cfgHvrPpaJobs
]
| compiler <- reverse $ toList linuxVersions
, compiler /= GHCHead -- TODO: Make this work
-- https://github.com/haskell-CI/haskell-ci/issues/458
]
})

unless (null cfgIrcChannels) $
ircJob actionName mainJobName projectName config gitconfig
}
Expand Down
8 changes: 5 additions & 3 deletions src/HaskellCI/GitHub/Yaml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ data GitHubJob = GitHubJob
}
deriving (Show)

data SetupMethod = HVRPPA | GHCUP
data SetupMethod = HVRPPA | GHCUP | GHCUPvanilla | GHCUPprerelease
deriving Show

data GitHubMatrixEntry = GitHubMatrixEntry
Expand Down Expand Up @@ -130,8 +130,10 @@ instance ToYaml GitHubJob where
item $ "steps" ~> ylistFilt [] (map toYaml $ filter notEmptyStep ghjSteps)

instance ToYaml SetupMethod where
toYaml HVRPPA = "hvr-ppa"
toYaml GHCUP = "ghcup"
toYaml HVRPPA = "hvr-ppa"
toYaml GHCUP = "ghcup"
toYaml GHCUPvanilla = "ghcup-vanilla"
toYaml GHCUPprerelease = "ghcup-prerelease"

instance ToYaml GitHubMatrixEntry where
toYaml GitHubMatrixEntry {..} = ykeyValuesFilt []
Expand Down

0 comments on commit 96b0868

Please sign in to comment.