[CI] Optimize CI: refine check-bypass/cancel logic and fix nightly task (#6939)

* [CI] Optimize CI: add check-bypass for workflow skip control

* fix ci_image_build and publish_job

* [CI] Optimize CI: add check-bypass and cancel

* [CI] update to PFCCLab/ci-bypass@v2
This commit is contained in:
YuBaoku
2026-03-20 19:34:45 +08:00
committed by GitHub
parent 00eb12f656
commit 030820db4c
21 changed files with 281 additions and 8 deletions
+12
View File
@@ -27,10 +27,22 @@ on:
required: false
type: string
default: ""
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: base_test
base_tests:
runs-on: [self-hosted, GPU-h20-1Cards]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 60
steps:
- name: Code Prepare
+13
View File
@@ -57,9 +57,22 @@ on:
wheel_path:
description: "Output path of the generated wheel"
value: ${{ jobs.fd-build.outputs.wheel_path }}
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: build_gpu
fd-build:
runs-on: [self-hosted, GPU-Build]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 360
outputs:
wheel_path: ${{ steps.set_output.outputs.wheel_path }}
+13
View File
@@ -36,9 +36,22 @@ on:
wheel_path:
description: "Output path of the generated wheel"
value: ${{ jobs.xpu-build-test.outputs.wheel_path }}
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: build_xpu
xpu-build-test:
runs-on: [self-hosted, XPU-P800]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
outputs:
wheel_path: ${{ steps.set_output.outputs.wheel_path }}
steps:
+13
View File
@@ -12,10 +12,23 @@ on:
repo_archive_url:
description: "Compressed source code archive."
value: ${{ jobs.code-clone.outputs.repo_archive_url }}
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: code_clone
code-clone:
runs-on:
group: HK-Clone
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
outputs:
repo_archive_url: ${{ steps.set_output.outputs.repo_archive_url }}
steps:
@@ -32,8 +32,17 @@ on:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: gpu_4cards_test
run_4_cards_tests:
runs-on: [self-hosted, GPU-h20-4Cards]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 30
steps:
- name: Code Prepare
+12
View File
@@ -22,10 +22,22 @@ on:
required: false
type: string
default: ""
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: ci_iluvatar
run_iluvatar_cases:
runs-on: iluvatar-gpu-2
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 60
container:
image: ${{ inputs.DOCKER_IMAGE }}
+12
View File
@@ -28,10 +28,22 @@ on:
required: false
type: string
default: ""
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: logprob_test
run_tests_logprob:
runs-on: [self-hosted, GPU-h20-1Cards]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 60
steps:
- name: Code Prepare
+12
View File
@@ -26,10 +26,22 @@ on:
required: false
type: string
default: ""
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: pre_ce_test
run_ce_cases:
runs-on: [self-hosted, PRE_CE_RUN_2Card]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 60
steps:
- name: Print current runner name
+12
View File
@@ -27,10 +27,22 @@ on:
required: false
type: string
default: ""
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: stable_test
stable_tests:
runs-on: [self-hosted, GPU-h20-2Cards]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 60
steps:
- name: Code Prepare
@@ -36,10 +36,22 @@ on:
required: true
type: string
default: ""
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: xpu_4cards_test
run_xpu_4cards_cases:
runs-on: [self-hosted, XPU-P800-4Cards]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 60
steps:
- name: Print current runner name
@@ -36,10 +36,22 @@ on:
required: true
type: string
default: ""
secrets:
github-token:
required: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.github-token }}
with:
workflow-name: xpu_8cards_test
run_xpu_8cards_cases:
runs-on: [self-hosted, XPU-P800-8Cards]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
timeout-minutes: 60
steps:
- name: Print current runner name
+20
View File
@@ -0,0 +1,20 @@
name: ILUVATAR-CI
on:
pull_request:
types: [closed]
branches: [develop, release/**]
permissions: read-all
concurrency:
group: ${{ github.event.pull_request.number }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
cancel:
name: Cancel ILUVATAR-CI for ${{ github.event.pull_request.number }}
runs-on: ubuntu-latest
steps:
- name: Cancel ILUVATAR-CI
run: |
exit 0
+2 -2
View File
@@ -12,9 +12,9 @@ concurrency:
jobs:
cancel:
name: Cancel Coverage for ${{ github.event.pull_request.number }}
name: Cancel CI_XPU for ${{ github.event.pull_request.number }}
runs-on: ubuntu-latest
steps:
- name: Cancel Coverage
- name: Cancel CI_XPU
run: |
exit 0
+4
View File
@@ -174,6 +174,8 @@ jobs:
WITH_NIGHTLY_BUILD: OFF
FD_VERSION: 0.0.0
PADDLE_WHL_URL: ${{ needs.ce_job_pre_check.outputs.compile_use_paddle_whl_url }}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
build_sm8090_rl:
name: BUILD_SM8090_RL
@@ -200,6 +202,8 @@ jobs:
WITH_NIGHTLY_BUILD: OFF
FD_VERSION: 0.0.0
PADDLE_WHL_URL: ${{ needs.ce_job_pre_check.outputs.compile_use_paddle_whl_url }}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
ce_upload_sm8090:
environment: CodeSync
+54 -2
View File
@@ -11,6 +11,9 @@ on:
can-skip:
description: "Whether the workflow can be skipped."
value: ${{ jobs.check-bypass.outputs.can-skip }}
can-skip-docs:
description: "Whether the workflow can be skipped due to docs-only change."
value: ${{ jobs.check-bypass.outputs.can-skip-docs }}
jobs:
check-bypass:
@@ -21,7 +24,8 @@ jobs:
env:
CI_TEAM_MEMBERS: '["yuanlehome","YuanRisheng","Jiang-Jia-Jun","DDDivano","XieYunshen","EmmonsCurse","CSWYF3634076"]'
outputs:
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
can-skip: ${{ steps.final-output.outputs.can-skip }}
can-skip-docs: ${{ steps.final-output.outputs.can-skip-docs }}
steps:
- name: Cleanup
run: |
@@ -29,7 +33,7 @@ jobs:
- id: check-bypass
name: Check Bypass
uses: PFCCLab/ci-bypass@v1
uses: PFCCLab/ci-bypass@v2
with:
github-token: ${{ secrets.github-token }}
non-pull-request-event-strategy: 'never-skipped'
@@ -49,3 +53,51 @@ jobs:
}
]
}
- id: check-only-docs
name: Check if only Docs files changed
env:
GITHUB_TOKEN: ${{ secrets.github-token }}
run: |
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
echo "can-skip-docs=false" >> "$GITHUB_OUTPUT"
exit 0
fi
files=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json files --jq '.files[].path')
echo "$files"
can_skip_docs=true
for f in $files; do
if [[ ! "$f" =~ \.(md|txt|yaml|go)$ ]]; then
can_skip_docs=false
break
fi
done
echo "can-skip-docs=$can_skip_docs" >> "$GITHUB_OUTPUT"
- id: final-output
name: Final can-skip result
run: |
if [[ "${{ steps.check-only-docs.outputs['can-skip-docs'] }}" == "true" ]]; then
echo "can-skip=true" >> "$GITHUB_OUTPUT"
echo "can-skip-docs=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if [[ "${{ steps.check-bypass.outputs['can-skip'] }}" == "true" ]]; then
echo "can-skip=true" >> "$GITHUB_OUTPUT"
echo "can-skip-docs=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "can-skip=false" >> "$GITHUB_OUTPUT"
echo "can-skip-docs=false" >> "$GITHUB_OUTPUT"
- id: print-final-output
name: Print final result
run: |
echo "===== Final can-skip result ====="
echo "can-skip=${{ steps.final-output.outputs['can-skip'] }}"
echo "can-skip-docs=${{ steps.final-output.outputs['can-skip-docs'] }}"
+9
View File
@@ -12,8 +12,17 @@ concurrency:
cancel-in-progress: true
jobs:
check_bypass:
uses: ./.github/workflows/check-bypass.yml
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
with:
workflow-name: ci_hpu
CI_HPU:
runs-on: [self-hosted, HPU-8Card]
needs: check_bypass
if: ${{ needs.check_bypass.outputs.can-skip != 'true' }}
steps:
- name: Print current runner name
run: |
+4
View File
@@ -13,6 +13,8 @@ jobs:
clone:
name: FD-Clone-Linux-ILUVATAR
uses: ./.github/workflows/_clone_linux.yml
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
iluvatar_test:
name: Run iluvatar Tests
@@ -21,3 +23,5 @@ jobs:
with:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-ixuca:3.3.0-20260312
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
+23 -3
View File
@@ -80,7 +80,6 @@ jobs:
CI_DOCKER_IMAGE_NAME: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-dailyupdate-precheck
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
build_sm8090:
name: BUILD_SM8090
needs: [clone, ci_image_build]
@@ -93,7 +92,8 @@ jobs:
FD_VERSION: ${{ needs.publish_pre_check.outputs.fd_version }}
PADDLEVERSION: ${{ needs.publish_pre_check.outputs.compile_use_paddle_version }}
PADDLE_WHL_URL: ${{ needs.publish_pre_check.outputs.compile_use_paddle_whl_url }}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
unittest_coverage:
name: Run FastDeploy Unit Tests and Coverage
@@ -107,6 +107,18 @@ jobs:
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
four_cards_test:
name: Run Four Cards Tests
needs: [clone,build_sm8090,ci_image_build]
uses: ./.github/workflows/_gpu_4cards_case_test.yml
with:
DOCKER_IMAGE: ${{ needs.ci_image_build.outputs.docker_name_precheck }}
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_sm8090.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
logprob_test:
name: Run FastDeploy LogProb Tests
needs: [build_sm8090,ci_image_build]
@@ -116,6 +128,8 @@ jobs:
PADDLETEST_ARCHIVE_URL: "https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz"
FASTDEPLOY_WHEEL_URL: ${{ needs.build_sm8090.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
pre_ce_test:
name: Extracted partial CE model tasks to run in CI.
@@ -126,6 +140,8 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_sm8090.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
base_test:
name: Run Base Tests
@@ -136,6 +152,8 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_sm8090.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
stable_test:
name: Run Stable Tests
@@ -146,10 +164,12 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_sm8090.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
publish_pre_check:
name: Publish Docker Images Pre Check
needs: [ci_image_build,unittest_coverage,logprob_test,pre_ce_test,base_test,stable_test]
needs: [ci_image_build,unittest_coverage,four_cards_test,logprob_test,pre_ce_test,base_test,stable_test]
runs-on: [self-hosted, Docker-Build]
steps:
- name: Images Uploading
+8
View File
@@ -14,6 +14,8 @@ jobs:
clone:
name: FD-Clone-Linux-XPU
uses: ./.github/workflows/_clone_linux.yml
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
xpu_build_test:
name: xpu_build_test
@@ -22,6 +24,8 @@ jobs:
with:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/fastdeploy-xpu:ci
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
xpu_4cards_case_test:
name: xpu_4cards_case_test
@@ -32,6 +36,8 @@ jobs:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/fastdeploy-xpu:ci
FASTDEPLOY_WHEEL_URL: ${{ needs.xpu_build_test.outputs.wheel_path }}
MODEL_PATH: /ssd3/model
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
xpu_8cards_case_test:
name: xpu_8cards_case_test
@@ -42,3 +48,5 @@ jobs:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/fastdeploy-xpu:ci
FASTDEPLOY_WHEEL_URL: ${{ needs.xpu_build_test.outputs.wheel_path }}
MODEL_PATH: /ssd3/model
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
+12
View File
@@ -13,6 +13,8 @@ jobs:
clone:
name: FD-Clone-Linux
uses: ./.github/workflows/_clone_linux.yml
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
build:
name: FD-Build-Linux
@@ -24,6 +26,8 @@ jobs:
COMPILE_ARCH: "90"
WITH_NIGHTLY_BUILD: "OFF"
FD_VERSION: "0.0.0"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
resultshow:
name: Use Build Output
@@ -67,6 +71,8 @@ jobs:
PADDLETEST_ARCHIVE_URL: "https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz"
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
pre_ce_test:
name: Extracted partial CE model tasks to run in CI.
@@ -77,6 +83,8 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
base_test:
name: Run Base Tests
@@ -87,6 +95,8 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
stable_test:
name: Run Stable Tests
@@ -97,3 +107,5 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
+13 -1
View File
@@ -189,6 +189,8 @@ jobs:
PADDLEVERSION: ${{ needs.publish_pre_check.outputs.compile_use_paddle_version }}
PADDLE_WHL_URL: ${{ needs.publish_pre_check.outputs.compile_use_paddle_whl_url }}
FD_UNIFY_BUILD: "true"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
build_cu129:
name: BUILD_cu129
@@ -440,7 +442,7 @@ jobs:
needs: [clone,build_cu126]
uses: ./.github/workflows/_unit_test_coverage.yml
with:
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-dailyupdate
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-ciuse-cuda126-paddle-dev
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_cu126.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
@@ -481,6 +483,8 @@ jobs:
PADDLETEST_ARCHIVE_URL: "https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz"
FASTDEPLOY_WHEEL_URL: ${{ needs.build_cu126.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
pre_ce_test:
name: Extracted partial CE model tasks to run in CI.
@@ -491,6 +495,8 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_cu126.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
base_test:
name: Run Base Tests
@@ -501,6 +507,8 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_cu126.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
accuracy_test:
name: Run Accuracy Tests
@@ -511,6 +519,8 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_cu126.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
stable_test:
name: Run Stable Tests
@@ -521,3 +531,5 @@ jobs:
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
FASTDEPLOY_WHEEL_URL: ${{ needs.build_cu126.outputs.wheel_path }}
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}