summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-12-04 14:24:52 +0800
committerGitHub <noreply@github.com>2024-12-04 14:24:52 +0800
commit0c7801b627ae09e6998bf1ce3f9bb5af1f17567c (patch)
tree227ba98d3ad86ce75414cf7eaa0df63207c1b438
parent743c4808f70fef1573e24d7d13e28e37008ec83f (diff)
Run a do-nothing CI job for documentation changes (#5747)
Closes https://github.com/shader-slang/slang/issues/5689
-rw-r--r--.github/workflows/ci.yml36
1 files changed, 21 insertions, 15 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 675daaa9f..1303d7fca 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,20 +3,8 @@ name: CI
on:
push:
branches: [master]
- paths-ignore:
- - "docs/**"
- - "LICENSES/**"
- - "LICENSE"
- - "CONTRIBUTING.md"
- - "README.md"
pull_request:
branches: [master]
- paths-ignore:
- - "docs/**"
- - "LICENSES/**"
- - "LICENSE"
- - "CONTRIBUTING.md"
- - "README.md"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@@ -91,7 +79,24 @@ jobs:
with:
submodules: "recursive"
fetch-depth: "0"
+ - id: filter
+ run: |
+ # This step prevents subsequent steps from running if only documentation was changed
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
+ git fetch origin ${{ github.base_ref }}
+ BASE=origin/${{ github.base_ref }}
+ else
+ BASE=HEAD^1
+ fi
+ if git diff --name-only -z $BASE...HEAD |
+ grep --null-data -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then
+ echo "should-run=true" >> $GITHUB_OUTPUT
+ else
+ echo "Only documentation files changed, skipping remaining steps"
+ echo "should-run=false" >> $GITHUB_OUTPUT
+ fi
- name: Setup
+ if: steps.filter.outputs.should-run == 'true'
uses: ./.github/actions/common-setup
with:
os: ${{matrix.os}}
@@ -100,6 +105,7 @@ jobs:
config: ${{matrix.config}}
build-llvm: ${{ matrix.platform != 'wasm' }}
- name: Build Slang
+ if: steps.filter.outputs.should-run == 'true'
run: |
if [[ "${{ matrix.platform }}" = "wasm" ]]; then
git clone https://github.com/emscripten-core/emsdk.git
@@ -138,7 +144,7 @@ jobs:
fi
fi
- name: Test Slang
- if: ${{ matrix.platform != 'wasm' }}
+ if: steps.filter.outputs.should-run == 'true' && matrix.platform != 'wasm'
run: |
export SLANG_RUN_SPIRV_VALIDATION=1
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -164,7 +170,7 @@ jobs:
-expected-failure-list tests/expected-failure-record-replay-tests.txt
fi
- name: Test Slang via glsl
- if: ${{ matrix.full-gpu-tests && matrix.platform != 'wasm' }}
+ if: steps.filter.outputs.should-run == 'true' && matrix.full-gpu-tests && matrix.platform != 'wasm'
run: |
export SLANG_RUN_SPIRV_VALIDATION=1
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -176,7 +182,7 @@ jobs:
-api vk \
-expected-failure-list tests/expected-failure.txt
- uses: actions/upload-artifact@v3
- if: ${{ ! matrix.full-gpu-tests }}
+ if: steps.filter.outputs.should-run == 'true' && ! matrix.full-gpu-tests
with:
name: slang-build-${{matrix.os}}-${{matrix.platform}}-${{matrix.compiler}}-${{matrix.config}}
# The install directory used in the packaging step