Closed mbj closed 4 years ago
I think the issue you're running into might be resolved by toggling the stack-no-global
option to true
(cf. the Inputs section).
That being said, I think an option to disable installing cabal-install
and running cabal update
would be really nice in certain use cases.
For example, I've currently got a workflow that uses stack
with the version that this action provides. I'm not using cabal
so I'd prefer that cabal update
not run, but there's no way to disable this without disabling the global GHC install.
@jkachmar Not entirely fixes my problem. This option indeed skips the Setting up cabal
step but also skips the GHC setup. While stack can setup its own GHC, the ideal build latency is reached when using the already cached system GHC that is distributed with the GH action base images.
I thought about creating a build-tool option, but given that it would introduce complexity, I opted to just not run cabal setup
if stack is enabled for now. Many people run cabal update
in their workflows anyway as the original action didn't run it for you. Doing it twice is pretty much instant, but doing it once when you don't need to takes up time. Will that work for you?
I opted to just not run
cabal setup
if stack is enabled for now.
That works for me.
Interestingly I had to update to actions/setup-haslell@v1.1.1
to get the new behavior. @v1.1
did not pick it up. I suspect this is a problem outside the scope of this project and has to do with the github actions inference, so not a blocker.
Your change removed ~30s from most of my haskell builds. Thanks. Closing this.
It's because the 1.1 tag didn't get updated to point to 1.1.1 as well; only the v1 tag got updated. Not sure if that's a github practice or not.
For projects that use stack this part of the haskell setup action job can likely be skipped:
Especially the download after
cabal update
takes multiple seconds that are AFAIK just redundant on a stack build.I suspect that it may be best to have a
build-tool: stack|cabal
option (defaulting to cabal). And ifstack
is selected it removes the cabal specific actions, and also setsenable-stack: true
.