This is an automated email from the ASF dual-hosted git repository.
snuyanzin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new ef5249330c1 [FLINK-39595][ci] Use GHA cache per branch
ef5249330c1 is described below
commit ef5249330c12c47a15e3894fe684b1ecc5082e65
Author: Sergey Nuyanzin <[email protected]>
AuthorDate: Mon May 4 10:01:11 2026 +0200
[FLINK-39595][ci] Use GHA cache per branch
---
.github/actions/job_init/action.yml | 28 ++++++++++++++++++++++++++--
.github/workflows/template.flink-ci.yml | 4 ++--
2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/.github/actions/job_init/action.yml
b/.github/actions/job_init/action.yml
index e10e6f0e77e..921af788883 100644
--- a/.github/actions/job_init/action.yml
+++ b/.github/actions/job_init/action.yml
@@ -74,13 +74,37 @@ runs:
echo "JAVA_HOME=$JAVA_HOME_${{ inputs.jdk_version }}_X64" >>
"${GITHUB_ENV}"
echo "PATH=$JAVA_HOME_${{ inputs.jdk_version }}_X64/bin:$PATH" >>
"${GITHUB_ENV}"
+ - name: "Determine cache namespace (PR base | branch | tag)"
+ id: cache-ns
+ shell: bash
+ run: |
+ # For PR runs use the target branch so PRs share a cache pool with the
branch they merge into.
+ # For push / workflow_dispatch / tag pushes, use the ref name itself.
+ if [ "${{ github.event_name }}" = "pull_request" ] || [ "${{
github.event_name }}" = "pull_request_target" ]; then
+ ns="${{ github.base_ref }}"
+ else
+ ns="${{ github.ref_name }}"
+ fi
+ # Map release tags (release-X.Y.Z, release-X.Y.Z-rcN) back to their
parent branch
+ # (release-X.Y) so tag builds reuse the branch's warm cache.
+ case "${ns}" in
+ release-[0-9]*.[0-9]*.[0-9]*) ns="$(printf '%s' "${ns}" | sed
's/^\(release-[0-9][0-9]*\.[0-9][0-9]*\)\..*/\1/')" ;;
+ esac
+ # Sanitize for use in a cache key (no slashes, spaces, etc.).
+ ns="$(printf '%s' "${ns}" | tr -c '[:alnum:]._-' '-')"
+ echo "namespace=${ns}" >> "${GITHUB_OUTPUT}"
+ echo "Cache namespace: ${ns}"
+
- name: "Setup Maven package cache"
if: ${{ inputs.maven_repo_folder != '' }}
uses: actions/cache@v5
with:
path: ${{ inputs.maven_repo_folder }}
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-maven
+ key: ${{ runner.os }}-ns-${{ steps.cache-ns.outputs.namespace
}}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
+ restore-keys: |
+ ${{ runner.os }}-ns-${{ steps.cache-ns.outputs.namespace
}}-maven-${{ hashFiles('**/pom.xml') }}-
+ ${{ runner.os }}-ns-${{ steps.cache-ns.outputs.namespace }}-maven-
+ ${{ runner.os }}-maven-
- name: "Moves checkout content from ${{ inputs.source_directory }} to ${{
inputs.target_directory }}."
if: ${{ inputs.source_directory != '' && inputs.target_directory != '' }}
diff --git a/.github/workflows/template.flink-ci.yml
b/.github/workflows/template.flink-ci.yml
index 1c1a5111892..fa4bca38a04 100644
--- a/.github/workflows/template.flink-ci.yml
+++ b/.github/workflows/template.flink-ci.yml
@@ -106,7 +106,7 @@ jobs:
timeout-minutes: ${{ fromJSON(env.GHA_JOB_TIMEOUT) }}
with:
working_directory: ${{ env.CONTAINER_LOCAL_WORKING_DIR }}
- maven-parameters: "test-compile -Dflink.markBundledAsOptional=false
-Dfast"
+ maven-parameters: "-T 1C test-compile
-Dflink.markBundledAsOptional=false -Dfast"
env: "${{ inputs.environment }}"
- name: "Collect build artifacts"
@@ -405,7 +405,7 @@ jobs:
- name: "Build Flink"
uses: "./.github/actions/run_mvn"
with:
- maven-parameters: "install -DskipTests -Dfast $PROFILE
-Pskip-webui-build"
+ maven-parameters: "install -DskipTests -Dfast $PROFILE
-Pskip-webui-build -T1C"
env: "${{ inputs.environment }}"
- name: "Run E2E Tests"