Skip to content

Commit 0c7801b

Browse files
authored
Run a do-nothing CI job for documentation changes (#5747)
Closes #5689
1 parent 743c480 commit 0c7801b

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

.github/workflows/ci.yml

+21-15
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,8 @@ name: CI
33
on:
44
push:
55
branches: [master]
6-
paths-ignore:
7-
- "docs/**"
8-
- "LICENSES/**"
9-
- "LICENSE"
10-
- "CONTRIBUTING.md"
11-
- "README.md"
126
pull_request:
137
branches: [master]
14-
paths-ignore:
15-
- "docs/**"
16-
- "LICENSES/**"
17-
- "LICENSE"
18-
- "CONTRIBUTING.md"
19-
- "README.md"
208
concurrency:
219
group: ${{ github.workflow }}-${{ github.ref }}
2210
cancel-in-progress: true
@@ -91,7 +79,24 @@ jobs:
9179
with:
9280
submodules: "recursive"
9381
fetch-depth: "0"
82+
- id: filter
83+
run: |
84+
# This step prevents subsequent steps from running if only documentation was changed
85+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
86+
git fetch origin ${{ github.base_ref }}
87+
BASE=origin/${{ github.base_ref }}
88+
else
89+
BASE=HEAD^1
90+
fi
91+
if git diff --name-only -z $BASE...HEAD |
92+
grep --null-data -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then
93+
echo "should-run=true" >> $GITHUB_OUTPUT
94+
else
95+
echo "Only documentation files changed, skipping remaining steps"
96+
echo "should-run=false" >> $GITHUB_OUTPUT
97+
fi
9498
- name: Setup
99+
if: steps.filter.outputs.should-run == 'true'
95100
uses: ./.github/actions/common-setup
96101
with:
97102
os: ${{matrix.os}}
@@ -100,6 +105,7 @@ jobs:
100105
config: ${{matrix.config}}
101106
build-llvm: ${{ matrix.platform != 'wasm' }}
102107
- name: Build Slang
108+
if: steps.filter.outputs.should-run == 'true'
103109
run: |
104110
if [[ "${{ matrix.platform }}" = "wasm" ]]; then
105111
git clone https://github.com/emscripten-core/emsdk.git
@@ -138,7 +144,7 @@ jobs:
138144
fi
139145
fi
140146
- name: Test Slang
141-
if: ${{ matrix.platform != 'wasm' }}
147+
if: steps.filter.outputs.should-run == 'true' && matrix.platform != 'wasm'
142148
run: |
143149
export SLANG_RUN_SPIRV_VALIDATION=1
144150
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -164,7 +170,7 @@ jobs:
164170
-expected-failure-list tests/expected-failure-record-replay-tests.txt
165171
fi
166172
- name: Test Slang via glsl
167-
if: ${{ matrix.full-gpu-tests && matrix.platform != 'wasm' }}
173+
if: steps.filter.outputs.should-run == 'true' && matrix.full-gpu-tests && matrix.platform != 'wasm'
168174
run: |
169175
export SLANG_RUN_SPIRV_VALIDATION=1
170176
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -176,7 +182,7 @@ jobs:
176182
-api vk \
177183
-expected-failure-list tests/expected-failure.txt
178184
- uses: actions/upload-artifact@v3
179-
if: ${{ ! matrix.full-gpu-tests }}
185+
if: steps.filter.outputs.should-run == 'true' && ! matrix.full-gpu-tests
180186
with:
181187
name: slang-build-${{matrix.os}}-${{matrix.platform}}-${{matrix.compiler}}-${{matrix.config}}
182188
# The install directory used in the packaging step

0 commit comments

Comments
 (0)