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

GitHub Actions cache build on main branch #222

Merged
merged 3 commits into from
Jul 12, 2023

Conversation

triffer
Copy link
Collaborator

@triffer triffer commented Jul 11, 2023

Description
With our current config we create a cache with go dependencies for every PR. This caches can only be re-used in the same PR. That means the first workflows in a PR always have to download the dependencies, even when there are not changes to the dependencies.
To avoid that we can leverage the built-in usage of caches from the main branch.

Access restrictions provide cache isolation and security by creating a logical boundary between different branches or tags. Workflow runs can restore caches created in either the current branch or the default branch (usually main).

GitHub cache docs

Changes proposed in this pull request:

  • Add main workflow with a step to run go build and create the cache

Related issue(s)

@triffer triffer requested a review from a team as a code owner July 11, 2023 06:05
@kyma-bot kyma-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 11, 2023
.github/workflows/main.yaml Outdated Show resolved Hide resolved
.github/workflows/main.yaml Outdated Show resolved Hide resolved
@kyma-bot kyma-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 12, 2023
@kyma-bot kyma-bot added the lgtm Looks good to me! label Jul 12, 2023
@triffer triffer requested a review from barchw July 12, 2023 09:30
@kyma-bot kyma-bot merged commit 46bb78b into kyma-project:main Jul 12, 2023
3 checks passed
@triffer triffer deleted the main-cache-build branch July 12, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Looks good to me! size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants