[CI] Fixing release with cut branch workflow (#16153)

Co-authored-by: Kangyan Zhou <zky314343421@gmail.com>
This commit is contained in:
Baizhou Zhang
2025-12-30 17:18:02 +08:00
committed by GitHub
co-authored by Kangyan Zhou
parent 94bcc19bce
commit 98225be6e5
9 changed files with 317 additions and 47 deletions
+23 -5
View File
@@ -13,11 +13,11 @@ on:
required: false
type: string
default: ''
job_filter:
description: 'Select which job to run (leave empty or "all" to run all jobs)'
run_all_tests:
description: "Run all tests (for releasing or testing purpose)"
required: false
type: string
default: 'all'
type: boolean
default: false
concurrency:
group: pr-test-xeon-${{ github.ref }}
@@ -28,14 +28,30 @@ jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
main_package: ${{ steps.filter.outputs.main_package }}
main_package: ${{ steps.filter.outputs.main_package || steps.run-mode.outputs.run_all_tests}}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Determine run mode
id: run-mode
run: |
# Run all tests for workflow_call (when ref input is provided)
# Note: github.event_name is inherited from caller, so we detect workflow_call by checking inputs.ref
if [[ "${{ inputs.run_all_tests }}" == "true" ]]; then
echo "run_all_tests=true" >> $GITHUB_OUTPUT
echo "Run mode: ALL TESTS (run_all_tests=${{ inputs.run_all_tests }})"
else
echo "run_all_tests=false" >> $GITHUB_OUTPUT
echo "Run mode: FILTERED (triggered by ${{ github.event_name }})"
fi
- name: Detect file changes
id: filter
uses: dorny/paths-filter@v3
if: steps.run-mode.outputs.run_all_tests != 'true'
with:
filters: |
main_package:
@@ -66,6 +82,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Build and Push
run: |