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

chore(ci): re-use cache key from build workflow #11299

Merged
merged 2 commits into from
Jul 27, 2023
Merged

Conversation

flrgh
Copy link
Contributor

@flrgh flrgh commented Jul 26, 2023

This makes build cache key generation reusable across different workflows. The test and release workflows now use the same "recipe" for cache key generation--no more copy/paste.

@github-actions github-actions bot added the chore Not part of the core functionality of kong, but still needed label Jul 26, 2023
@flrgh flrgh force-pushed the chore/ci-reuse-cache-key branch from a2f10b9 to 0286e5e Compare July 26, 2023 18:08
@flrgh flrgh changed the title Chore/ci reuse cache key feat(ci): re-use cache key from build workflow Jul 26, 2023
@flrgh flrgh marked this pull request as draft July 26, 2023 18:08
@flrgh flrgh marked this pull request as ready for review July 26, 2023 18:29
@flrgh flrgh force-pushed the chore/ci-reuse-cache-key branch 2 times, most recently from 48809a6 to 338bfc0 Compare July 26, 2023 19:29
@flrgh flrgh force-pushed the chore/ci-reuse-cache-key branch from 338bfc0 to cadcb37 Compare July 26, 2023 19:41
@flrgh flrgh changed the title feat(ci): re-use cache key from build workflow chore(ci): re-use cache key from build workflow Jul 26, 2023
Copy link
Contributor

@curiositycasualty curiositycasualty left a comment

Choose a reason for hiding this comment

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

Good idea.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jul 27, 2023
@flrgh flrgh force-pushed the chore/ci-reuse-cache-key branch from 8dc1e0c to cbab956 Compare July 27, 2023 17:17
@flrgh flrgh force-pushed the chore/ci-reuse-cache-key branch from cbab956 to 7129e52 Compare July 27, 2023 17:22
@flrgh
Copy link
Contributor Author

flrgh commented Jul 27, 2023

I've also updated perf.yml since it was also using a one-off cache key formula.

@flrgh flrgh merged commit 68b7b6f into master Jul 27, 2023
@flrgh flrgh deleted the chore/ci-reuse-cache-key branch July 27, 2023 18:16
@team-gateway-bot
Copy link
Collaborator

The backport to release/3.4.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.4.x release/3.4.x
# Navigate to the new working tree
cd .worktrees/backport-release/3.4.x
# Create a new branch
git switch --create backport-11299-to-release/3.4.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 68b7b6f9cb9eb52af0ed558b2952a3239926b5b7
# Push it to GitHub
git push --set-upstream origin backport-11299-to-release/3.4.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.4.x

Then, create a pull request where the base branch is release/3.4.x and the compare/head branch is backport-11299-to-release/3.4.x.

flrgh added a commit that referenced this pull request Jul 27, 2023
This makes build cache key generation reusable across different workflows. The test and release workflows now use the same "recipe" for cache key generation--no more copy/paste.
flrgh added a commit that referenced this pull request Jul 27, 2023
This makes build cache key generation reusable across different workflows. The test and release workflows now use the same "recipe" for cache key generation--no more copy/paste.
${{ hashFiles('build/**') }}
${{ hashFiles('kong-*.rockspec') }}
${{ hashFiles('kong.conf.default') }}
${{ hashFiles('kong/**') }}
Copy link
Contributor

@fffonion fffonion Jul 31, 2023

Choose a reason for hiding this comment

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

this should not be set for non-release workflows (build_and_test, perf), because almost every PR change lua codes and cause a cache miss (unless the PR only changes tests, which is a less common case).

@kikito kikito mentioned this pull request Aug 9, 2023
fffonion pushed a commit that referenced this pull request Sep 12, 2023
This updates the `build-cache-key` action to accept additional paths to use when generating the cache key. The impetus for this change is to allow removal of `kong/**` from the default cache key so that it can be used selectively.

See also: #11299 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Not part of the core functionality of kong, but still needed size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants