Skip to content

Commit 2ca63c4

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 makes it possible to add another "dimension" to the matrix using only `--github-patches`, by adding another list of values. As a concrete example, the *notmuch* library must be tested against various versions of libnotmuch: matrix: notmuch: ["0.29.3", "0.30", "0.31.3", "git"] ghc: - 8.10.3 - 8.8.4 include: - ghc: 8.10.3 allow-failures: false - ghc: 8.8.4 allow-failures: false The resulting matrix is the cartesian product of the values from the "ghc" and other list(s). The additional matrix line(s), and corresponding build steps, can be introduced via --github-patch. The "include" maps propagate the "allow-failures" field to the matrix legs with matching "ghc" version (evidence: https://github.com/purebred-mua/hs-notmuch/actions/runs/466042178).
1 parent a4ea1ed commit 2ca63c4

10 files changed

+265
-1
lines changed

fixtures/all-versions.github

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,45 @@ jobs:
2525
continue-on-error: ${{ matrix.allow-failure }}
2626
strategy:
2727
matrix:
28+
ghc:
29+
- 8.10.3
30+
- 8.10.2
31+
- 8.10.1
32+
- 8.8.4
33+
- 8.8.3
34+
- 8.8.2
35+
- 8.8.1
36+
- 8.6.5
37+
- 8.6.4
38+
- 8.6.3
39+
- 8.6.2
40+
- 8.6.1
41+
- 8.4.4
42+
- 8.4.3
43+
- 8.4.2
44+
- 8.4.1
45+
- 8.2.2
46+
- 8.2.1
47+
- 8.0.2
48+
- 8.0.1
49+
- 7.10.3
50+
- 7.10.2
51+
- 7.10.1
52+
- 7.8.4
53+
- 7.8.3
54+
- 7.8.2
55+
- 7.8.1
56+
- 7.6.3
57+
- 7.6.2
58+
- 7.6.1
59+
- 7.4.2
60+
- 7.4.1
61+
- 7.2.2
62+
- 7.2.1
63+
- 7.0.4
64+
- 7.0.3
65+
- 7.0.2
66+
- 7.0.1
2867
include:
2968
- ghc: 8.10.3
3069
allow-failure: false

fixtures/copy-fields-all.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ jobs:
2525
continue-on-error: ${{ matrix.allow-failure }}
2626
strategy:
2727
matrix:
28+
ghc:
29+
- 8.10.3
30+
- 8.10.2
31+
- 8.10.1
32+
- 8.8.4
33+
- 8.8.3
34+
- 8.8.2
35+
- 8.8.1
36+
- 8.6.5
37+
- 8.6.4
38+
- 8.6.3
39+
- 8.6.2
40+
- 8.6.1
41+
- 8.4.4
42+
- 8.4.3
43+
- 8.4.2
44+
- 8.4.1
45+
- 8.2.2
46+
- 8.2.1
47+
- 8.0.2
48+
- 8.0.1
49+
- 7.10.3
50+
- 7.10.2
51+
- 7.10.1
52+
- 7.8.4
53+
- 7.8.3
54+
- 7.8.2
55+
- 7.8.1
2856
include:
2957
- ghc: 8.10.3
3058
allow-failure: false

fixtures/copy-fields-none.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ jobs:
2525
continue-on-error: ${{ matrix.allow-failure }}
2626
strategy:
2727
matrix:
28+
ghc:
29+
- 8.10.3
30+
- 8.10.2
31+
- 8.10.1
32+
- 8.8.4
33+
- 8.8.3
34+
- 8.8.2
35+
- 8.8.1
36+
- 8.6.5
37+
- 8.6.4
38+
- 8.6.3
39+
- 8.6.2
40+
- 8.6.1
41+
- 8.4.4
42+
- 8.4.3
43+
- 8.4.2
44+
- 8.4.1
45+
- 8.2.2
46+
- 8.2.1
47+
- 8.0.2
48+
- 8.0.1
49+
- 7.10.3
50+
- 7.10.2
51+
- 7.10.1
52+
- 7.8.4
53+
- 7.8.3
54+
- 7.8.2
55+
- 7.8.1
2856
include:
2957
- ghc: 8.10.3
3058
allow-failure: false

fixtures/copy-fields-some.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ jobs:
2525
continue-on-error: ${{ matrix.allow-failure }}
2626
strategy:
2727
matrix:
28+
ghc:
29+
- 8.10.3
30+
- 8.10.2
31+
- 8.10.1
32+
- 8.8.4
33+
- 8.8.3
34+
- 8.8.2
35+
- 8.8.1
36+
- 8.6.5
37+
- 8.6.4
38+
- 8.6.3
39+
- 8.6.2
40+
- 8.6.1
41+
- 8.4.4
42+
- 8.4.3
43+
- 8.4.2
44+
- 8.4.1
45+
- 8.2.2
46+
- 8.2.1
47+
- 8.0.2
48+
- 8.0.1
49+
- 7.10.3
50+
- 7.10.2
51+
- 7.10.1
52+
- 7.8.4
53+
- 7.8.3
54+
- 7.8.2
55+
- 7.8.1
2856
include:
2957
- ghc: 8.10.3
3058
allow-failure: false

fixtures/empty-line.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ jobs:
2525
continue-on-error: ${{ matrix.allow-failure }}
2626
strategy:
2727
matrix:
28+
ghc:
29+
- 8.10.3
30+
- 8.10.2
31+
- 8.10.1
32+
- 8.8.4
33+
- 8.8.3
34+
- 8.8.2
35+
- 8.8.1
36+
- 8.6.5
37+
- 8.6.4
38+
- 8.6.3
39+
- 8.6.2
40+
- 8.6.1
41+
- 8.4.4
42+
- 8.4.3
43+
- 8.4.2
44+
- 8.4.1
45+
- 8.2.2
46+
- 8.2.1
47+
- 8.0.2
48+
- 8.0.1
49+
- 7.10.3
50+
- 7.10.2
51+
- 7.10.1
52+
- 7.8.4
53+
- 7.8.3
54+
- 7.8.2
55+
- 7.8.1
2856
include:
2957
- ghc: 8.10.3
3058
allow-failure: false

fixtures/irc-channels.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,34 @@ jobs:
5050
continue-on-error: ${{ matrix.allow-failure }}
5151
strategy:
5252
matrix:
53+
ghc:
54+
- 8.10.3
55+
- 8.10.2
56+
- 8.10.1
57+
- 8.8.4
58+
- 8.8.3
59+
- 8.8.2
60+
- 8.8.1
61+
- 8.6.5
62+
- 8.6.4
63+
- 8.6.3
64+
- 8.6.2
65+
- 8.6.1
66+
- 8.4.4
67+
- 8.4.3
68+
- 8.4.2
69+
- 8.4.1
70+
- 8.2.2
71+
- 8.2.1
72+
- 8.0.2
73+
- 8.0.1
74+
- 7.10.3
75+
- 7.10.2
76+
- 7.10.1
77+
- 7.8.4
78+
- 7.8.3
79+
- 7.8.2
80+
- 7.8.1
5381
include:
5482
- ghc: 8.10.3
5583
allow-failure: false

fixtures/messy.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ jobs:
2525
continue-on-error: ${{ matrix.allow-failure }}
2626
strategy:
2727
matrix:
28+
ghc:
29+
- 8.10.3
30+
- 8.10.2
31+
- 8.10.1
32+
- 8.8.4
33+
- 8.8.3
34+
- 8.8.2
35+
- 8.8.1
36+
- 8.6.5
37+
- 8.6.4
38+
- 8.6.3
39+
- 8.6.2
40+
- 8.6.1
41+
- 8.4.4
42+
- 8.4.3
43+
- 8.4.2
44+
- 8.4.1
45+
- 8.2.2
46+
- 8.2.1
47+
- 8.0.2
48+
- 8.0.1
49+
- 7.10.3
50+
- 7.10.2
51+
- 7.10.1
52+
- 7.8.4
53+
- 7.8.3
54+
- 7.8.2
55+
- 7.8.1
2856
include:
2957
- ghc: 8.10.3
3058
allow-failure: false

fixtures/psql.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,34 @@ jobs:
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
34+
ghc:
35+
- 8.10.3
36+
- 8.10.2
37+
- 8.10.1
38+
- 8.8.4
39+
- 8.8.3
40+
- 8.8.2
41+
- 8.8.1
42+
- 8.6.5
43+
- 8.6.4
44+
- 8.6.3
45+
- 8.6.2
46+
- 8.6.1
47+
- 8.4.4
48+
- 8.4.3
49+
- 8.4.2
50+
- 8.4.1
51+
- 8.2.2
52+
- 8.2.1
53+
- 8.0.2
54+
- 8.0.1
55+
- 7.10.3
56+
- 7.10.2
57+
- 7.10.1
58+
- 7.8.4
59+
- 7.8.3
60+
- 7.8.2
61+
- 7.8.1
3462
include:
3563
- ghc: 8.10.3
3664
allow-failure: false

fixtures/travis-patch.github

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ jobs:
2525
continue-on-error: ${{ matrix.allow-failure }}
2626
strategy:
2727
matrix:
28+
ghc:
29+
- 8.10.3
30+
- 8.10.2
31+
- 8.10.1
32+
- 8.8.4
33+
- 8.8.3
34+
- 8.8.2
35+
- 8.8.1
36+
- 8.6.5
37+
- 8.6.4
38+
- 8.6.3
39+
- 8.6.2
40+
- 8.6.1
41+
- 8.4.4
42+
- 8.4.3
43+
- 8.4.2
44+
- 8.4.1
45+
- 8.2.2
46+
- 8.2.1
47+
- 8.0.2
48+
- 8.0.1
49+
- 7.10.3
50+
- 7.10.2
51+
- 7.10.1
52+
- 7.8.4
53+
- 7.8.3
54+
- 7.8.2
55+
- 7.8.1
2856
include:
2957
- ghc: 8.10.3
3058
allow-failure: false

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)