-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (54 loc) · 1.68 KB
/
Copy pathopengl.yml
File metadata and controls
64 lines (54 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: OpenGL
on:
push:
branches: [main]
paths:
- "src/**"
- "assets/shaders/**"
- "config/**"
pull_request:
branches: [main]
concurrency:
group: opengl-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect OpenGL-related changes
runs-on: ubuntu-latest
outputs:
relevant: ${{ steps.filter.outputs.relevant }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Detect relevant file changes
id: filter
shell: bash
run: |
if [ "${{ github.event_name }}" != "pull_request" ]; then
echo "relevant=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -Eq '^(src/|assets/shaders/|config/)'; then
echo "relevant=true" >> "$GITHUB_OUTPUT"
else
echo "relevant=false" >> "$GITHUB_OUTPUT"
fi
shader-validation:
name: Shader Validation
needs: changes
if: needs.changes.outputs.relevant == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Install glslang
run: sudo apt-get update && sudo apt-get install -y glslang-tools
- name: Validate GLSL shaders
run: |
SHADERS=$(find assets/shaders -type f \( -name "*.vert" -o -name "*.frag" -o -name "*.geom" -o -name "*.comp" \))
echo "Found $(echo "$SHADERS" | wc -l) shaders"
echo "$SHADERS" | xargs glslangValidator