actions / setup-haskell

Set up your GitHub Actions workflow with a specific version of Haskell (GHC and Cabal)
MIT License
71 stars 30 forks source link

Add Windows, macOS, and Stack Support (#1) #12

Closed hazelweakly closed 4 years ago

hazelweakly commented 4 years ago

This commit represents the work done on haskell-CI/setup, specifically the add-windows-macos branch. It closes several issues and pull requests. In doing so, it is effectively a full rewrite of the repo (although certain pains have been taken to keep the git history as sane as possible)

Linux will check for existing installs of GHC/Cabal and use those when possible. Thus, this offers the benefit of having zero regression in functionality and CPU cycles over the current state while being a strict addition of functionality.

Additional configuration inputs have been added based on my experiences writing CI systems for Galois and common annoyances people have in "real world projects" that make use of Cabal, Nix, Stack, or multiple combinations thereof. All inputs are fully documented and tested.

I will also be following up with GitHub to see if we can get common versions of GHC/Cabal/Stack baked into the environments for all operating systems. I have some suggestions that should save a decent amount of space in their images.

Lastly, I am willing and able to step up to help maintain and improve this project if you so wish. One thing I am very interested in is getting this action on the marketplace.


Fixes #1 Fixes #7 Fixes #10 Fixes #11

hazelweakly commented 4 years ago

@tclem @ethomson, anything I can do to assist in the process of getting this in?

tclem commented 4 years ago

@jared-w thanks for all the great work here! Let me track down someone working directly on actions every day to help review and answer your other questions about being a maintainer and getting this action in the marketplace (I'm a contributor here just out of needing a haskell build environment 😄).

I will also be following up with GitHub to see if we can get common versions of GHC/Cabal/Stack baked into the environments for all operating systems.

If you haven't found it already, that will happen in https://github.com/actions/virtual-environments

tclem commented 4 years ago

@jared-w, when you get a chance will you merge latest master into your branch here (and fix workflow.yml conflicts)? I enabled running this repo's tests on pull requests.

JasonGross commented 4 years ago

I am looking to use this to get newer versions of ghc on my project to test a bug I may have found in ghc (https://gitlab.haskell.org/ghc/ghc/issues/18038). Am I correct in reading the .md file that even after this is merged, there will still be no support for 8.10.1 nor for HEAD?

patrickt commented 4 years ago

@JasonGross I think 8.10 should work, since it's installed on the runners and present in the hvr package. GHC HEAD is a trickier proposition, since we'd need to figure out how to build and distribute it and keep it updated.

hazelweakly commented 4 years ago

I've merged in the updates I've been working on for a bit to the haskell-CI/setup master branch. At this point I think I've finished implementing the functionality in a way that'll make it much easier to add support for recognizing pre-installed binaries on macOS and Windows (for when actions/virtual-environments#645 is implemented.

The setup should now be much more ergonomic by default.

GHC 8.10 should indeed work.

Support for HEAD will be trickier as the underlying tools don't always have the best support for it. (In fact, chocolatey, ghcup, and the PPA don't have any support for installing HEAD versions of haskell currently). I don't really know how I could ergonomically add support for that but I'm open to suggestions.

patrickt commented 4 years ago

Support for HEAD will be trickier as the underlying tools don't always have the best support for it. (In fact, chocolatey, ghcup, and the PPA don't have any support for installing HEAD versions of haskell currently). I don't really know how I could ergonomically add support for that but I'm open to suggestions.

I don’t think we need to worry about HEAD. Given the difficulty of even installing it, I feel justified in saying that we can pass on that complexity to the people who absolutely need it (and I’m not sure how many people who need GHC HEAD are gonna use GH Actions anyway).

hazelweakly commented 4 years ago

I don’t think we need to worry about HEAD.

This is my thinking as well. The infrastructure around being able to obtain a nightly version of the compiler isn't super fleshed out at the moment as Haskell is catching up to the tooling game.

That being said, I'm not opposed to revisiting that should the windows situation change, but such a change would likely require that ghcup and chocolatey have support for downloading nightlies.

So, as it stands, it looks like this branch is essentially feature complete. Are there any remaining blockers to getting it in? The latest status of actions/virtual-environments#645 looks like it's going to be a while before that gets merged in. Is this completely dependent on that?

tclem commented 4 years ago

This is looking good. I've done a local run through and am now going to test out on one of our haskell projects that was already using the setup-haskell action.

@jared-w, I think we should rev the version here to v1.1 (would be OK to do in a follow up PR) and make sure the README and other documentation reflects that. Also, what do you think about adding a list of contributors to the README?

tclem commented 4 years ago

Build looks good on https://github.com/github/semantic/pull/545/checks?check_run_id=626680941.

@jared-w, I'm going to merge this. Will you open a new PR to do a version rev? I'm happy to cut the release on github if you'll help me craft some release notes.

hazelweakly commented 4 years ago

@tclem absolutely. I'll open the PR and draft some release notes as well. Thanks for all your help!