-
Notifications
You must be signed in to change notification settings - Fork 697
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
Avoid templating GitHub Actions workflow #7952
Conversation
1b616ec
to
fb4f095
Compare
fb4f095
to
acaf3c8
Compare
Hmm.. why isn't the linux job running? |
/shurg I don't know. I am working to be able to test this out locally (with act). I will review the failures on Monday. |
Looks like the workflow is invalid https://github.com/haskell/cabal/actions/runs/1794333751 |
GitHub Actions workflow have sufficient power to express what we need. We don't need to maintain and additional templating solution on top.
- Run bootstrap.yml on ubuntu-latest - Use explicit matrix for linux.yml - Drop containers in favour of haskell setup action - Drop workaround for ancient git
I belive this is only necessary to run `cabal man` which we do not in the CI.
01ec4e3
to
9305e3f
Compare
Rebased |
Also add the same GHC versions as Linux.
The workflows for macos and linux at this point are very similar and could be merged. They only differ in how they install |
- Remove cabal-plan, we actually never call it (I think) - Remove vendored cabal-doctest - Remove few stray allow-newer clauses no longer necessary, apparently Originally done by @gbaz in PR haskell#7907.
That was a unsung epic travispocalypse, thank you for your work. I think there are two directions in ci lock in (or adoption :-P):
And for the top inputs we always could have it encoded in a ci agnostic data format and inject it in the ci provider, if ci allows to do it (see the linked above https://www.cynkra.com/blog/2020-12-23-dynamic-gha/) |
For completeness, they are not code but it could be computed, deriving it from other sources, to avoid duplication of such sensitive data. EDIT: want to note GenValidate did not compute the values but they were duplicated and hardcoded in the haskell code |
I have a minor nitpick: the experimental builds are marked as failing, so the entire build is marked that way. Those workflows will not be added to branch protection ruels and prs will be merged anyways but aesthetically it does not look nice Otoh, have them red is a compelling reason to work on fixing this so i am not strongly against it, thoughts? In hls we have a final post-jobs which marks the final workflow state, not sure if it could help: |
Only the "branches" are marked as failing, the entire workflow is green if all the required branched pass, see https://github.com/haskell/cabal/actions/runs/1863088120
This is a good idea (especially in relation to the post about dynamic workflows you posted). But, again, my intention is to try to simplify all variations rather than capturing them perfectly. |
|
||
defSteps :: [String] | ||
defSteps = | ||
[ "print-config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm steps also lives here, sad to see they go away
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks again, really a great work
This pr cant be merged automatically, as it changes required jobs names as commented above we can change branch protection rules to match new identifiers and merge it (to check both pr jobs and updated ruels) and then aaaall prs need to be rebased to pass ci //cc @Mikolaj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'll merge tomorrow if nobody objects. Specifically, let's squash-merge since there are a lot of fixup commits. @andreabedini if you don't want them squashed please tell!
Thanks a lot @andreabedini! Now I just have to re-select the required jobs... please ping me or @Mikolaj if prs are stuck because of that |
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4 | ||
- name: Validate lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2 | ||
run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2 | ||
- name: Validate lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaics it is not intentional and should be restored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are deprecating build cabal with ghc < 8.0, all older version should be checked using a newer build (including 7.8 and 7.10) like < 7.6 before this pr
EDIT: the haskell setup action fall back to apt inlinux so maybe it could be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the oldest ghc instalable with ghcup is 7.10.3, so we have to continue using apt if we want to keep older ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phadej It was intentional, following #7534 but now I think I have misunderstood.
We are deprecating building with GHC < 8.0 but we still want to test cabal can use GHC 7.8 and 7.10. Is this correct?
It's a bit of headache (which GHC version we should use to compile the cabal that compiles with what GHC version?) but it can definitely be readded.
Mind adding an issue to track? Please mention me there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreabedini: great job! I might have mislead you re #7534. Let's clean up the fallout later on. Edit: in #8000.
The linux and macos validate jobs has the same name and in my experience tha does not play well with branch protection rules, which needs unique jobs names |
Thanks a lot everyone <3 It's been a jouney for me! |
* Avoid templating GitHub Actions workflow GitHub Actions workflow have sufficient power to express what we need. We don't need to maintain and additional templating solution on top. * Add GHC 9.2, bump bounds, fix syntax * Switch to official haskell image * Always run cli tests for ghc 8.2 and above * Remove step to regenerate GitHub Actions workflows * Fix missed reference to GHC version * Fix yaml syntax * Fix type in the GHC version * More CI changes - Run bootstrap.yml on ubuntu-latest - Use explicit matrix for linux.yml - Drop containers in favour of haskell setup action - Drop workaround for ancient git * Remove unneeded package from CI setup I belive this is only necessary to run `cabal man` which we do not in the CI. * Drop old GHCs from the CI * Switch macos.yml to haskell/action/setup Also add the same GHC versions as Linux. * Simplify CI - Remove cabal-plan, we actually never call it (I think) - Remove vendored cabal-doctest - Remove few stray allow-newer clauses no longer necessary, apparently Originally done by @gbaz in PR haskell#7907. * Mark GHC 9.2.1 as experimental * Remove reference to cabal-plan from validate.sh * setup-haskell action already runs cabal update * Add missing build matrix in test-windows-dogfood * Replace cabal-plan list-bin with cabal list-bin * Enable caching in the CI * Fix typo * Remove continue-on-error until I figure it out * Keep naming consistent * Temporarily disable 8.0.2 on macos * Add missing step id * Tweaks Remove workaround for nektos/act, it accidentally sneaked in. * More tweaks * Tweaks * Restore cabal-plan, temporarily mark everything experimental cabal list-bin doesn't seem to work like cabal-plan does. * Tweaks * Ensure cabal-plan executable gets built * Install automake on MacOS * Tweaks * Tweaks Link experimental flags to relative GitHub issues * Fix typo
* Avoid templating GitHub Actions workflow GitHub Actions workflow have sufficient power to express what we need. We don't need to maintain and additional templating solution on top. * Add GHC 9.2, bump bounds, fix syntax * Switch to official haskell image * Always run cli tests for ghc 8.2 and above * Remove step to regenerate GitHub Actions workflows * Fix missed reference to GHC version * Fix yaml syntax * Fix type in the GHC version * More CI changes - Run bootstrap.yml on ubuntu-latest - Use explicit matrix for linux.yml - Drop containers in favour of haskell setup action - Drop workaround for ancient git * Remove unneeded package from CI setup I belive this is only necessary to run `cabal man` which we do not in the CI. * Drop old GHCs from the CI * Switch macos.yml to haskell/action/setup Also add the same GHC versions as Linux. * Simplify CI - Remove cabal-plan, we actually never call it (I think) - Remove vendored cabal-doctest - Remove few stray allow-newer clauses no longer necessary, apparently Originally done by @gbaz in PR haskell#7907. * Mark GHC 9.2.1 as experimental * Remove reference to cabal-plan from validate.sh * setup-haskell action already runs cabal update * Add missing build matrix in test-windows-dogfood * Replace cabal-plan list-bin with cabal list-bin * Enable caching in the CI * Fix typo * Remove continue-on-error until I figure it out * Keep naming consistent * Temporarily disable 8.0.2 on macos * Add missing step id * Tweaks Remove workaround for nektos/act, it accidentally sneaked in. * More tweaks * Tweaks * Restore cabal-plan, temporarily mark everything experimental cabal list-bin doesn't seem to work like cabal-plan does. * Tweaks * Ensure cabal-plan executable gets built * Install automake on MacOS * Tweaks * Tweaks Link experimental flags to relative GitHub issues * Fix typo
GitHub Actions workflow have sufficient power to express what we need.
We don't need to maintain and additional templating solution on top.
This converts:
linux.yml
,macos.yml
andwindows.yml
to native GitHub Actions syntax.The result should closely (but perhaps not perfectly) match the original version.EDIT:
It would be better to check GHC versions withI am instartsWith(matrix.ghc, "8.10")
otherwise bumping minor versions is going to be error pronePlease include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!