Skip to content

Commit 70b4eb8

Browse files
zhuyutong332zzx-study
authored andcommitted
CI execution requirements for separating a2 and a3 (sgl-project#367)
* implement ops/ops2 separation logic * Triggering CI
1 parent 4078779 commit 70b4eb8

File tree

1 file changed

+54
-6
lines changed

1 file changed

+54
-6
lines changed

.github/workflows/pr-test-npu.yml

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,47 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21+
get-changed-files:
22+
name: Check changed files
23+
runs-on: ubuntu-latest
24+
outputs:
25+
ops2_changed: ${{ steps.match-groups.outputs.ops2_any_changed }}
26+
ops_changed: ${{ steps.match-groups.outputs.ops_any_changed }}
27+
common_changed: ${{ steps.match-groups.outputs.common_any_changed }}
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Match changed files
35+
id: match-groups
36+
uses: tj-actions/changed-files@v45
37+
with:
38+
files_yaml: |
39+
ops:
40+
- csrc/deepep/ops/**
41+
ops2:
42+
- csrc/deepep/ops2/**
43+
common:
44+
- csrc/**
45+
- '!csrc/deepep/ops/**'
46+
- '!csrc/deepep/ops2/**'
47+
- build.sh
48+
- cmake/**
49+
- python/**
50+
- test/**
51+
- scripts/**
52+
- .github/workflows/pr-test-npu.yml
53+
2154
test-all-build:
22-
if: (github.repository == 'sgl-project/sgl-kernel-npu' || github.event_name == 'pull_request') &&
23-
github.event.pull_request.draft == false
55+
needs: get-changed-files
56+
if: |
57+
github.event_name == 'workflow_dispatch' || (
58+
(github.repository == 'sgl-project/sgl-kernel-npu' || github.event_name == 'pull_request') &&
59+
github.event.pull_request.draft == false &&
60+
(needs.get-changed-files.outputs.ops_changed == 'true' || needs.get-changed-files.outputs.common_changed == 'true')
61+
)
2462
runs-on: linux-aarch64-a3-16
2563
container:
2664
image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.3.rc1-a3-ubuntu22.04-py3.11
@@ -336,8 +374,13 @@ jobs:
336374
run: bash scripts/generalization_test_fused_deep_moe.sh
337375

338376
test-build-deepep-a3:
339-
if: (github.repository == 'sgl-project/sgl-kernel-npu' || github.event_name == 'pull_request') &&
340-
github.event.pull_request.draft == false
377+
needs: get-changed-files
378+
if: |
379+
github.event_name == 'workflow_dispatch' || (
380+
(github.repository == 'sgl-project/sgl-kernel-npu' || github.event_name == 'pull_request') &&
381+
github.event.pull_request.draft == false &&
382+
(needs.get-changed-files.outputs.ops_changed == 'true' || needs.get-changed-files.outputs.common_changed == 'true')
383+
)
341384
runs-on: linux-aarch64-a3-16
342385
container:
343386
image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.3.rc1-a3-ubuntu22.04-py3.11
@@ -653,8 +696,13 @@ jobs:
653696
run: bash scripts/generalization_test_fused_deep_moe.sh
654697

655698
test-build-deepep-a2:
656-
if: (github.repository == 'sgl-project/sgl-kernel-npu' || github.event_name == 'pull_request') &&
657-
github.event.pull_request.draft == false
699+
needs: get-changed-files
700+
if: |
701+
github.event_name == 'workflow_dispatch' || (
702+
(github.repository == 'sgl-project/sgl-kernel-npu' || github.event_name == 'pull_request') &&
703+
github.event.pull_request.draft == false &&
704+
(needs.get-changed-files.outputs.ops2_changed == 'true' || needs.get-changed-files.outputs.common_changed == 'true')
705+
)
658706
runs-on: linux-aarch64-a2-8
659707
container:
660708
image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.3.rc1-910b-ubuntu22.04-py3.11

0 commit comments

Comments
 (0)