Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: include list of GHC versions in matrix #461

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions fixtures/all-versions.github
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,45 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
- 7.6.3
- 7.6.2
- 7.6.1
- 7.4.2
- 7.4.1
- 7.2.2
- 7.2.1
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
include:
- ghc: 8.10.3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How these would match against your proposed multi-dimension matrx?

Note: there is plan to change the matrix to be

- compiler: ghc
  version: 8.10.3

as we want to support GHCJS

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej my objective is to enable addition of more matrix dimensions and associated build steps via --github-patches. For example, see purebred-mua/hs-notmuch@8b1d0f0#diff-486acc743e8f02cb435d1b164fe0a8389b3572f0199d79ed24c9fa7fe686f21b . That patch works with this PR and, importantly, remains applicable and works as intended even as the GHC versions change, saving maintainer busywork.

The alternative is that after every change to Tested-With and subsequent haskell-ci regenerate, the maintainer has to manually reinstate all their changes to the matrix. I have always had to do this with Travis, and I do not want to keep doing it with GitHub Actions :)

Unfortunately, the suggested split of the ghc field into compiler and version fields, as you described above, does not support this approach.

However, if instead you could do it like:

hc:
  - ghc-8.10.3
  - ghc-8.8.4
include:
  - hc: ghc-8.10.3
    allow-failures: false
  - hc: ghc-8.8.4
    allow-failures: false

Then that would enable maintainers to add more matrix dimensions via a patch (and that patch can remain valid as Tested-With changes).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having hc: ghc-8.8.4 would mean that we need to go to regexp magic to separate version from the compiler (which we had to do in Travis for other reasons). And we couldn't have if: matrix.compiler == "ghcjs" checks.

I'm sorry, but this would mean a regression in code quality which I cannot accept now. You can maintain a fork of haskell-ci, for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej OK, how would you feel about a first-class haskell-ci option/argument to add the new matrix dimension, and perform the expansion within haskell-ci. So something like:

$ haskell-ci --expand-matrix "notmuch:0.31.3,git"

To result in:

matrix:
  include:
    - ghc: 8.10.3
      notmuch: 0.31.3
      allow-failures: false
    - ghc: 8.10.3
      notmuch: git
      allow-failures: false
    - ghc: 8.8.4
      notmuch: 0.31.3
      allow-failures: false
    - ghc: 8.8.4
      notmuch: git
      allow-failures: false

And similarly under the planned change to have separate compiler and version fields.

Would this approach be acceptable?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej I submitted PR #462 implementing the alternative approach I suggested above. Closing this PR.

allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/copy-fields-all.github
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/copy-fields-none.github
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/copy-fields-some.github
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/empty-line.github
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/irc-channels.github
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/messy.github
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/psql.github
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
28 changes: 28 additions & 0 deletions fixtures/travis-patch.github
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ jobs:
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
ghc:
- 8.10.3
- 8.10.2
- 8.10.1
- 8.8.4
- 8.8.3
- 8.8.2
- 8.8.1
- 8.6.5
- 8.6.4
- 8.6.3
- 8.6.2
- 8.6.1
- 8.4.4
- 8.4.3
- 8.4.2
- 8.4.1
- 8.2.2
- 8.2.1
- 8.0.2
- 8.0.1
- 7.10.3
- 7.10.2
- 7.10.1
- 7.8.4
- 7.8.3
- 7.8.2
- 7.8.1
include:
- ghc: 8.10.3
allow-failure: false
Expand Down
3 changes: 2 additions & 1 deletion src/HaskellCI/GitHub/Yaml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ instance ToYaml GitHubJob where
item $ "continue-on-error" ~> fromString continueOnError
item $ "strategy" ~> ykeyValuesFilt []
[ "matrix" ~> ykeyValuesFilt []
[ "include" ~> ylistFilt [] (map toYaml ghjMatrix)
[ "ghc" ~> ylistFilt [] (map (fromString . prettyShow . ghmeGhcVersion) ghjMatrix)
, "include" ~> ylistFilt [] (map toYaml ghjMatrix)
]
, "fail-fast" ~> YBool [] False
]
Expand Down