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

AAE-17877 skip saving maven cache on PRs #380

Merged
merged 12 commits into from
Nov 27, 2023

Conversation

wojciech-piotrowiak
Copy link
Contributor

@wojciech-piotrowiak wojciech-piotrowiak commented Nov 21, 2023

Checklist

  • Jira Reference (also in PR title): AAE-17877
  • README updated after adding/changing behaviour of an action
  • Proposed version increment for release:
    • Patch (bugfix)
    • Minor (new feature)
    • Major (breaking changes)
  • External PR link where changes has been tested:

Description

We currently use cache action that will save changes on the m2 maven cache.
This could be improved by just restoring core dependencies from that cache on each build.
Once PR is merged that cache can be updated

@wojciech-piotrowiak wojciech-piotrowiak self-assigned this Nov 21, 2023
@wojciech-piotrowiak wojciech-piotrowiak marked this pull request as ready for review November 21, 2023 19:27
@wojciech-piotrowiak wojciech-piotrowiak requested a review from a team as a code owner November 21, 2023 19:27
Copy link
Member

@gionn gionn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to better describe what you are trying to achieve here because I am completely missing the point

.github/actions/setup-java-build/action.yml Outdated Show resolved Hide resolved
@wojciech-piotrowiak wojciech-piotrowiak force-pushed the AAE-17877-m2-reducing-cache branch from 47ba8bb to 7e367f8 Compare November 24, 2023 14:45
version.txt Outdated Show resolved Hide resolved
@atchertchian atchertchian changed the title AAE-17877 m2 cache should be only restored on build startup AAE-17877 skip saving maven cache on PRs Nov 27, 2023

- name: Save maven cache
uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
if: github.event_name == 'push'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't prevent saving cache for branches different than the default one if the caller workflow is configured to build also those

something like && github.event.repository.default_branch == github.ref_name should fix that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think we want to keep the cache on maintenance branches, that's why keeping the logic checking event push makes more sense to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we need to consider maintenance branches as well, and we usually don't configure the CI to build on feature branches, so it should not be a problem.

@@ -229,3 +229,17 @@ runs:
run: |
git tag -a $VERSION -m "Release version $VERSION"
git push origin $VERSION

- name: Clean m2 cache
if: github.event_name == 'push'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also if the condition is changed this should be kept consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@erdemedeiros erdemedeiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wojciech-piotrowiak wojciech-piotrowiak merged commit 706d3f3 into master Nov 27, 2023
3 checks passed
@wojciech-piotrowiak wojciech-piotrowiak deleted the AAE-17877-m2-reducing-cache branch November 27, 2023 21:00
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

Successfully merging this pull request may close these issues.

4 participants