Skip to content

Commit 2008d74

Browse files
GitHub Actions: include list of GHC versions in matrix
Alongside "include" include the list of GHC versions in the matrix. That is, instead of: matrix: include: - ghc: 8.10.3 allow-failures: false - ghc: 8.8.4 allow-failures: false haskell-ci now produces: matrix: ghc: - 8.10.3 - 8.8.4 include: - ghc: 8.10.3 allow-failures: false - ghc: 8.8.4 allow-failures: false This approach reduces the work required to introduce another "dimension" into the matrix. As a concrete example, the /notmuch/ library must be tested against various versions of libnotmuch. With the "ghc" version list defined, adding the list of notmuch versions to test yields a matrix that is the cartesian product of the two (or more) lists. The "include" dicts correctly propagate the "allow-failures" fields to corresponding matrix legs (evidence: https://github.com/purebred-mua/hs-notmuch/actions/runs/466042178).
1 parent a4ea1ed commit 2008d74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/HaskellCI/GitHub/Yaml.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ instance ToYaml GitHubJob where
115115
item $ "continue-on-error" ~> fromString continueOnError
116116
item $ "strategy" ~> ykeyValuesFilt []
117117
[ "matrix" ~> ykeyValuesFilt []
118-
[ "include" ~> ylistFilt [] (map toYaml ghjMatrix)
118+
[ "ghc" ~> ylistFilt [] (map (fromString . prettyShow . ghmeGhcVersion) ghjMatrix)
119+
, "include" ~> ylistFilt [] (map toYaml ghjMatrix)
119120
]
120121
, "fail-fast" ~> YBool [] False
121122
]

0 commit comments

Comments
 (0)