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

Fix/improve Maven build times #911

Open
alecthomas opened this issue Feb 9, 2024 · 2 comments
Open

Fix/improve Maven build times #911

alecthomas opened this issue Feb 9, 2024 · 2 comments

Comments

@alecthomas
Copy link
Collaborator

They are the bulk of our CI time, and for some reason caching ~/.m2/repository doesn't seem to prevent mvn from downloading all its dependencies again?

Investigate https://github.com/avodonosov/hashver-maven-plugin/ for local development.

@github-actions github-actions bot added the triage Issue needs triaging label Feb 9, 2024
@alecthomas
Copy link
Collaborator Author

I listed the files in ~/.m2/repository as restored from the cache, and it just seems like they are very out of date, so perhaps I'm configuring actions/cache incorrectly somehow.

@alecthomas
Copy link
Collaborator Author

I think I know what is happening. The "Build Cache" internal action runs on nearly all steps, and caches the Go cache and the Maven repository. If the pom.xml file is changed, and the first step to complete doesn't do a Maven build, there will be no changes to the m2 repository, and the previous cache will be persisted as the new version.

I think the fix could be to always do a mvn dependency:resolve --batch-mode and a go mod download

alecthomas added a commit that referenced this issue Feb 9, 2024
Uses `grep` rather than `go test -list`, which has to download Go deps
and compile the source.

Also adds a post step to Build Cache that downloads all Maven and Go
dependencies.

I think this will address the CI issue in #911
@github-actions github-actions bot removed the triage Issue needs triaging label Feb 12, 2024
@alecthomas alecthomas added the next Work that will be be picked up next label Feb 14, 2024
@worstell worstell self-assigned this Feb 20, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Feb 20, 2024
@worstell worstell removed their assignment Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants