Skip to content

Commit cdd3103

Browse files
committed
Skip tests and checks when PR only contains docs changes
- Add pre-flight job to detect docs-only changes using FW-CI-templates - Skip cicd-wait-in-queue, unit tests, and e2e tests when docs_only is true - Skip copyright-check when docs_only is true - Skip build-test-publish-wheel when docs_only is true - Linting and ruff checks remain enabled for all PRs Signed-off-by: Pablo Garay <[email protected]>
1 parent 5c10b99 commit cdd3103

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

.github/workflows/build-test-publish-wheel.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ defaults:
2525
shell: bash -x -e -u -o pipefail {0}
2626

2727
jobs:
28+
pre-flight:
29+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
30+
2831
build-test-publish-wheel:
32+
needs: [pre-flight]
33+
if: |
34+
${{ vars.BUILD_TEST_PUBLISH_WHEEL == 'true' && !(needs.pre-flight.outputs.docs_only == 'true') }}
2935
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
30-
if: ${{ vars.BUILD_TEST_PUBLISH_WHEEL == 'true' }}
3136
with:
3237
dry-run: true
3338
python-package: dfm

.github/workflows/cicd-main.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,23 @@ permissions:
3232

3333
jobs:
3434

35+
pre-flight:
36+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
37+
3538
cicd-wait-in-queue:
39+
needs: [pre-flight]
3640
runs-on: ubuntu-latest
3741
environment: test
42+
if: |
43+
!(needs.pre-flight.outputs.docs_only == 'true')
3844
steps:
3945
- name: Running CI tests
4046
run: |
4147
echo "Running CI tests"
4248
4349
cicd-container-build:
4450
uses: ./.github/workflows/_build_container.yml
45-
needs: cicd-wait-in-queue
51+
needs: [cicd-wait-in-queue, pre-flight]
4652
with:
4753
image-name: dfm
4854
dockerfile: docker/Dockerfile.ci
@@ -63,7 +69,9 @@ jobs:
6369
- script: L0_Unit_Tests_CPU
6470
runner: linux-amd64-cpu16
6571
cpu-only: true
66-
needs: [cicd-container-build]
72+
needs: [cicd-container-build, pre-flight]
73+
if: |
74+
!(needs.pre-flight.outputs.docs_only == 'true')
6775
runs-on: ${{ matrix.runner }}
6876
name: ${{ matrix.script }}
6977
environment: nemo-ci
@@ -97,7 +105,9 @@ jobs:
97105
- script: L2_Automodel_Wan21_Test
98106
runner: self-hosted-nemo
99107
timeout: 30
100-
needs: [cicd-unit-tests]
108+
needs: [cicd-unit-tests, pre-flight]
109+
if: |
110+
!(needs.pre-flight.outputs.docs_only == 'true')
101111
runs-on: ${{ matrix.runner }}
102112
name: ${{ matrix.is_optional && 'PLEASEFIXME_' || '' }}${{ matrix.script }}
103113
environment: nemo-ci
@@ -124,6 +134,7 @@ jobs:
124134
- cicd-container-build
125135
- cicd-unit-tests
126136
- cicd-e2e-tests
137+
- pre-flight
127138
if: always()
128139
runs-on: ubuntu-latest
129140
permissions: write-all

.github/workflows/copyright-check.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,35 @@ on:
1818
pull_request:
1919

2020
jobs:
21+
pre-flight:
22+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
23+
2124
copyright-check:
25+
needs: [pre-flight]
26+
if: |
27+
!(needs.pre-flight.outputs.docs_only == 'true')
2228
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
29+
30+
copyright-check-summary:
31+
needs: [pre-flight, copyright-check]
32+
if: |
33+
(
34+
needs.pre-flight.outputs.docs_only == 'true'
35+
|| always()
36+
)
37+
&& !cancelled()
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Result
41+
run: |
42+
FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0
43+
44+
if [ "${FAILED_JOBS:-0}" -eq 0 ] || [ "$SKIPPING_IS_ALLOWED" == "true" ]; then
45+
echo "✅ All previous jobs completed successfully"
46+
exit 0
47+
else
48+
echo "❌ Found $FAILED_JOBS failed job(s)"
49+
# Show which jobs failed
50+
gh run view $GITHUB_RUN_ID --json jobs --jq '.jobs[] | select(.status == "completed" and .conclusion != "success") | .name'
51+
exit 1
52+
fi

0 commit comments

Comments
 (0)