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

Support GitHub actions #351

Closed
1 of 2 tasks
chshersh opened this issue Oct 15, 2019 · 5 comments
Closed
1 of 2 tasks

Support GitHub actions #351

chshersh opened this issue Oct 15, 2019 · 5 comments
Labels
CI CI tools support; project CI; build with different GHC, tools

Comments

@chshersh
Copy link
Contributor

chshersh commented Oct 15, 2019

They seem to work pretty nice and they have native support for Haskell with the following template:

So we can support them in summoner as well, specifically:

  • Create .github/workflows/ci.yml file
  • Create a badge in README

The only questions is how to configure them properly, maybe we want to support cachix

@chshersh chshersh added the CI CI tools support; project CI; build with different GHC, tools label Oct 15, 2019
@chshersh chshersh added this to the v2.0: Major update milestone Oct 15, 2019
@vrom911
Copy link
Member

vrom911 commented Oct 15, 2019

That's actually awesome idea!

Probably, to use it we want users to specify their cachix name then if we decide to go with that option. But I see that there are several ways to build in there. It all should depend on the build tool selected for the project, I guess.

@chshersh
Copy link
Contributor Author

The only restriction I can think of now is not to allow to use cachix if the user didn't select Nix build tool. And probably not allow to create them if the user selected only Stack (because the default template is for Cabal)? And, btw, GitHub actions also support build matrix in a quite nice way, but there's no easy way to specify build matrix with Nix builds. So, unfortunately, some non-uniformity is going to be present in how we handle GitHub actions for various build tools...

@patrickt
Copy link
Contributor

Please let me know if there’s anything that I can do to help out on this—I use GH Actions extensively for Haskell CI, and summoner support for it would be 💯

@chshersh
Copy link
Contributor Author

@patrickt Thanks for your interest! Supporting GitHub actions shouldn't be that hard 🙂 But it requires to add changes in a few places:

  • Add file template with content to the Summoner.Template.GitHub module. It would be nice if template comes with GitHub CI cache already enabled as well (I think we won't go with cachix until we support Nix). I see that setup-haskell action supports Cabal and GHC matrix. I propose to use defaultCabal for the cabal-install version and populate the matrix as we do everywhere. Inside these actions all our usual cabal new-* commands should be used. It would be also nice to support HLint, but I see from your issue that GitHub action for Haskell doesn't have HLint at the moment. It's not problem, we can add it later or just do it via curl as usual.
  • Add a field to the TOML config
  • Read this option from CLI somewhere here. Since GitHub actions don't support stack, I propose to ask for this CI only if cabal build tool is selected and only if GitHub is chosen.
  • And as a last step it would be also nice to add this option to TUI interface (to form and settings) in the corresponding group but this will require to take some UX decisions since we have kinda dense TUI already... But we can help with TUI if you're willing to open a PR 🙂

Does it make sense? Also, @vrom911, am I missing anything, does this look correct?

vrom911 pushed a commit that referenced this issue Jan 3, 2020
* Add cGhActions field to Config.

I don't know if this is the perfect field name, but it's good enough
for now.

* Add -a flag to the CLI (not sure how to test this)

* Add Actions prompt to the CLI.

Chose to show Travis only if GH Actions was not selected.

* Generate .github/workflows/haskell.yml.

* Fill out haskell.yml.

* Add a comment to the generated YAML re. caching strategies.

* Fix golden tests.

* Only prompt for actions in Cabal projects.

* Fix summoner-tui build.

* Apply suggestions from code review

Co-Authored-By: Dmitrii Kovanikov <[email protected]>

* haskell.yml => ci.yml.

* Adjust the tests.

* Fix remaining test issues from autocommit earlier.

* Use intercalateMap.

* Update summoner-cli/src/Summoner/Config.hs

Co-Authored-By: Dmitrii Kovanikov <[email protected]>

* Prompt for both Actions and Travis CI.

* alignment

Co-authored-by: Dmitrii Kovanikov <[email protected]>
@vrom911
Copy link
Member

vrom911 commented Jan 3, 2020

Resolved in #393

@vrom911 vrom911 closed this as completed Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI tools support; project CI; build with different GHC, tools
Projects
None yet
Development

No branches or pull requests

3 participants