setup-maven
setup-maven copied to clipboard
PR
I would like to make PR, to open up the .m2 home path for configuration.
Are you accepting PRs or is it in maintenance mode? 😊
https://github.com/stCarolas/setup-maven/blob/d55bf2a4b0216ee98317512d835fe2294b58648b/src/installer.ts#L16
this I would like to override with /github/home
, does it even make sense?
It's almost ok for me, but I think better to use $HOME or $USER/home or another way to detect home folder for current user without hardcoding user or entire path. Although I have not checked existence of $ HOME or $ USER variables in github environments.
I did some experiments yesterday and there is some stuff that is shared. The containers can not access outside the volumes logically, so the m2 would need to be in a folder which is mounted by default to the containers. These are:
-v "/var/run/docker.sock":"/var/run/docker.sock"
-v "/home/runners/actions-runner/_work/_temp/_github_home":"/github/home"
-v "/home/runners/actions-runner/_work/_temp/_github_workflow":"/github/workflow"
-v "/home/runners/actions-runner/_work/_temp/_runner_file_commands":"/github/file_commands"
-v "/home/runners/actions-runner/_work/basa-action-runner-test/basa-action-runner-test":"/github/workspace"
From all them I see only workspace
as candidate because the others are "temp" and I think they are just created on the fly maybe even per step and also quite hacky.
So if we could have workspace/.m2
that would be prime!
As I am no maven expert I dunno if this is applicable. But it would also open the possibility to push a settings.xml in it!
On a second note, this might make no sense as the workspace assumingly exists per workspace not per "runner".
Hmmm, how can one level1 cache maven on a runner?
@stCarolas we can also do in your action.yml:
inputs:
...
maven-home-dir:
default: '$HOME'
description: 'Where should the MAVEN_HOME be set to'
with examples:
inputs:
...
maven-home-dir:
default: '/github/workspace'
description: 'Where should the MAVEN_HOME be set to'
This example would make the m2 folder available for docker actions!
@mambax parameter in action.yml is good for me. Also I would prefer default value as in setup-java - so another actions will use same maven home by default.
I got in touch with GHES Support. I provided them a demo https://github.com/dominikmeyersap/actions-maven-demo/actions/runs/653849332
Now in there you see: Output of runner: <localRepository>/home/runner/.m2/repository</localRepository> Output of container action: <localRepository>/root/.m2/repository</localRepository>
I did not find a suitable solution yet as there is now way currently to handle volumes to docker actions (Except using container
option which is something completely different :D )
@dominikmeyersap what the point of running maven on agent and maven in docker simultaneously? Is the problem in mounting maven cache to container ?
Is the problem in mounting maven cache to container?
Correct 💯 We want to cache on the runner like Level1 all dependencies. And then the containers can use the runner as L1 cache instead of asking nexus for everything. It will speed up builds by 900% 😄
I have a gut feeling that with GHES 3 (which we get soon) we could use container: my-container
and then volume-mount the maven repo into them. But still I'd like to solve it already.