@@ -3,20 +3,8 @@ name: CI
3
3
on :
4
4
push :
5
5
branches : [master]
6
- paths-ignore :
7
- - " docs/**"
8
- - " LICENSES/**"
9
- - " LICENSE"
10
- - " CONTRIBUTING.md"
11
- - " README.md"
12
6
pull_request :
13
7
branches : [master]
14
- paths-ignore :
15
- - " docs/**"
16
- - " LICENSES/**"
17
- - " LICENSE"
18
- - " CONTRIBUTING.md"
19
- - " README.md"
20
8
concurrency :
21
9
group : ${{ github.workflow }}-${{ github.ref }}
22
10
cancel-in-progress : true
91
79
with :
92
80
submodules : " recursive"
93
81
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
94
98
- name : Setup
99
+ if : steps.filter.outputs.should-run == 'true'
95
100
uses : ./.github/actions/common-setup
96
101
with :
97
102
os : ${{matrix.os}}
@@ -100,6 +105,7 @@ jobs:
100
105
config : ${{matrix.config}}
101
106
build-llvm : ${{ matrix.platform != 'wasm' }}
102
107
- name : Build Slang
108
+ if : steps.filter.outputs.should-run == 'true'
103
109
run : |
104
110
if [[ "${{ matrix.platform }}" = "wasm" ]]; then
105
111
git clone https://github.com/emscripten-core/emsdk.git
@@ -138,7 +144,7 @@ jobs:
138
144
fi
139
145
fi
140
146
- name : Test Slang
141
- if : ${{ matrix.platform != 'wasm' }}
147
+ if : steps.filter.outputs.should-run == 'true' && matrix.platform != 'wasm'
142
148
run : |
143
149
export SLANG_RUN_SPIRV_VALIDATION=1
144
150
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -164,7 +170,7 @@ jobs:
164
170
-expected-failure-list tests/expected-failure-record-replay-tests.txt
165
171
fi
166
172
- 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'
168
174
run : |
169
175
export SLANG_RUN_SPIRV_VALIDATION=1
170
176
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -176,7 +182,7 @@ jobs:
176
182
-api vk \
177
183
-expected-failure-list tests/expected-failure.txt
178
184
- uses : actions/upload-artifact@v3
179
- if : ${{ ! matrix.full-gpu-tests }}
185
+ if : steps.filter.outputs.should-run == 'true' && ! matrix.full-gpu-tests
180
186
with :
181
187
name : slang-build-${{matrix.os}}-${{matrix.platform}}-${{matrix.compiler}}-${{matrix.config}}
182
188
# The install directory used in the packaging step
0 commit comments