Skip to content

Commit 852340d

Browse files
committed
ignore docs
1 parent 747517c commit 852340d

5 files changed

Lines changed: 42 additions & 2 deletions

File tree

.github/workflows/all_tests_ascend.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: ["main"]
66
paths-ignore:
7+
- 'docs/**'
78
- 'docker/cuda/**'
89
- 'docker/build.sh'
910
- 'tools/install/**'
@@ -13,6 +14,7 @@ on:
1314
pull_request:
1415
branches: ["main"]
1516
paths-ignore:
17+
- 'docs/**'
1618
- 'docker/cuda/**'
1719
- 'docker/build.sh'
1820
- 'tools/install/**'

.github/workflows/all_tests_cuda.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: ["main"]
66
paths-ignore:
7+
- 'docs/**'
78
- 'docker/cuda/**'
89
- 'docker/build.sh'
910
- 'tools/install/**'
@@ -13,6 +14,7 @@ on:
1314
pull_request:
1415
branches: ["main"]
1516
paths-ignore:
17+
- 'docs/**'
1618
- 'docker/cuda/**'
1719
- 'docker/build.sh'
1820
- 'tools/install/**'
@@ -25,19 +27,51 @@ concurrency:
2527
cancel-in-progress: true
2628

2729
jobs:
30+
# ---------------------------------------------------------------------------
31+
# Guard: skip tests when PR contains docker-related changes, because
32+
# build_image_cuda.yml will handle build + test for those PRs.
33+
# paths-ignore alone cannot guarantee mutual exclusivity when a PR touches
34+
# both docker files and non-docker files, so we need this job-level check.
35+
# ---------------------------------------------------------------------------
36+
check_docker_changes:
37+
runs-on: ubuntu-latest
38+
if: github.event_name == 'pull_request'
39+
outputs:
40+
has_docker_changes: ${{ steps.check.outputs.has_docker_changes }}
41+
steps:
42+
- name: Check for docker-related file changes
43+
id: check
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: |
47+
CHANGED=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files --paginate --jq '.[].filename')
48+
if echo "$CHANGED" | grep -qE '^(docker/cuda/|docker/build\.sh$|tools/install/|requirements/|\.github/workflows/build_image_cuda\.yml$)'; then
49+
echo "has_docker_changes=true" >> $GITHUB_OUTPUT
50+
else
51+
echo "has_docker_changes=false" >> $GITHUB_OUTPUT
52+
fi
53+
2854
run_tests:
55+
needs: check_docker_changes
56+
# On push: always run (paths-ignore already filtered).
57+
# On PR: only run when no docker-related files changed.
58+
if: always() && (github.event_name == 'push' || needs.check_docker_changes.outputs.has_docker_changes != 'true')
2959
# Package manager and environment settings are read from .github/configs/cuda.yml
3060
uses: ./.github/workflows/all_tests_common.yml
3161
with:
3262
platform: cuda
3363

3464
all_tests:
35-
needs: run_tests
65+
needs: [check_docker_changes, run_tests]
3666
runs-on: ubuntu-latest
3767
if: always()
3868
steps:
3969
- name: Verify workflow status
4070
run: |
71+
if [ "${{ needs.check_docker_changes.outputs.has_docker_changes }}" = "true" ]; then
72+
echo "⏭️ Skipped - docker changes detected, handled by build_image_cuda workflow"
73+
exit 0
74+
fi
4175
if [ "${{ needs.run_tests.result }}" != "success" ]; then
4276
echo "❌ Tests workflow failed"
4377
exit 1

.github/workflows/all_tests_metax.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: ["main"]
66
paths-ignore:
7+
- 'docs/**'
78
- 'docker/cuda/**'
89
- 'docker/build.sh'
910
- 'tools/install/**'
@@ -13,6 +14,7 @@ on:
1314
pull_request:
1415
branches: ["main"]
1516
paths-ignore:
17+
- 'docs/**'
1618
- 'docker/cuda/**'
1719
- 'docker/build.sh'
1820
- 'tools/install/**'

.github/workflows/build_image_cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ on:
6161
# Trigger on PRs that modify docker-related files (build + test only, no push)
6262
pull_request:
6363
branches: [main]
64-
paths:
64+
paths:
6565
- 'docker/cuda/**'
6666
- 'docker/build.sh'
6767
- 'tools/install/**'

.github/workflows/format_check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
branches: [ "main" ]
66
types: [opened, synchronize, reopened]
7+
paths-ignore:
8+
- 'docs/**'
79

810
jobs:
911
format:

0 commit comments

Comments
 (0)