yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Gangzheng TongCheck if any required jobs failed (allow success or skipped) (#8495)c6d8c6b68

master
8.0 KiB248 linesraw
1name: CI
2
3on:
4  workflow_dispatch:
5  merge_group:
6    types: [checks_requested]
7  pull_request:
8    branches: [master]
9concurrency:
10  group: ${{ github.workflow }}-${{ github.ref }}
11  cancel-in-progress: ${{ github.event_name != 'push' }}
12jobs:
13  filter:
14    runs-on: ubuntu-latest
15    outputs:
16      should-run: ${{ steps.filter.outputs.should-run }}
17    steps:
18      - uses: actions/checkout@v4
19        with:
20          fetch-depth: "2"
21      - id: filter
22        run: |
23          # This step prevents subsequent steps from running if only documentation was changed
24          if [[ "${{ github.event_name }}" == "pull_request" ]]; then
25            git fetch origin ${{ github.base_ref }}
26            BASE=origin/${{ github.base_ref }}
27          else
28            BASE=HEAD^1
29          fi
30
31          shouldRun=true
32          if files="$(git diff --name-only $BASE...HEAD)"; then
33            # Git diff succeeded, check if non-documentation files were changed
34            if echo "$files" | grep -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then
35              shouldRun=true
36            else
37              echo "Only documentation files changed, skipping remaining steps"
38              shouldRun=false
39            fi
40          else
41            echo "Git diff failed, conservatively running tests"
42            shouldRun=true
43          fi
44          echo "should-run=$shouldRun" >> $GITHUB_OUTPUT
45
46  # Linux builds
47  build-linux-debug-gcc-x86_64:
48    needs: [filter]
49    if: needs.filter.outputs.should-run == 'true'
50    uses: ./.github/workflows/ci-slang-build.yml
51    with:
52      os: linux
53      compiler: gcc
54      platform: x86_64
55      config: debug
56      runs-on: '["ubuntu-22.04"]'
57
58  build-linux-release-gcc-x86_64:
59    needs: [filter]
60    if: needs.filter.outputs.should-run == 'true'
61    uses: ./.github/workflows/ci-slang-build.yml
62    with:
63      os: linux
64      compiler: gcc
65      platform: x86_64
66      config: release
67      runs-on: '["ubuntu-22.04"]'
68
69  build-linux-release-gcc-wasm:
70    needs: [filter]
71    if: needs.filter.outputs.should-run == 'true'
72    uses: ./.github/workflows/ci-slang-build.yml
73    with:
74      os: linux
75      compiler: gcc
76      platform: wasm
77      config: release
78      runs-on: '["ubuntu-22.04"]'
79
80  # macOS builds
81  build-macos-debug-clang-aarch64:
82    needs: [filter]
83    if: needs.filter.outputs.should-run == 'true'
84    uses: ./.github/workflows/ci-slang-build.yml
85    with:
86      os: macos
87      compiler: clang
88      platform: aarch64
89      config: debug
90      runs-on: '["macos-latest"]'
91
92  build-macos-release-clang-aarch64:
93    needs: [filter]
94    if: needs.filter.outputs.should-run == 'true'
95    uses: ./.github/workflows/ci-slang-build.yml
96    with:
97      os: macos
98      compiler: clang
99      platform: aarch64
100      config: release
101      runs-on: '["macos-latest"]'
102
103  # Windows builds (self-hosted)
104  build-windows-debug-cl-x86_64-gpu:
105    needs: [filter]
106    if: needs.filter.outputs.should-run == 'true'
107    uses: ./.github/workflows/ci-slang-build.yml
108    with:
109      os: windows
110      compiler: cl
111      platform: x86_64
112      config: debug
113      runs-on: '["Windows", "self-hosted", "GCP-T4"]'
114
115  build-windows-release-cl-x86_64-gpu:
116    needs: [filter]
117    if: needs.filter.outputs.should-run == 'true'
118    uses: ./.github/workflows/ci-slang-build.yml
119    with:
120      os: windows
121      compiler: cl
122      platform: x86_64
123      config: release
124      runs-on: '["Windows", "self-hosted", "GCP-T4"]'
125
126  # Linux tests
127  test-linux-debug-gcc-x86_64:
128    needs: [filter, build-linux-debug-gcc-x86_64]
129    if: needs.filter.outputs.should-run == 'true'
130    uses: ./.github/workflows/ci-slang-test.yml
131    with:
132      os: linux
133      compiler: gcc
134      platform: x86_64
135      config: debug
136      runs-on: '["ubuntu-22.04"]'
137      test-category: smoke
138      server-count: 1
139
140  test-linux-release-gcc-x86_64:
141    needs: [filter, build-linux-release-gcc-x86_64]
142    if: needs.filter.outputs.should-run == 'true'
143    uses: ./.github/workflows/ci-slang-test.yml
144    with:
145      os: linux
146      compiler: gcc
147      platform: x86_64
148      config: release
149      runs-on: '["ubuntu-22.04"]'
150      test-category: full
151      server-count: 1
152
153  # macOS tests
154  test-macos-debug-clang-aarch64:
155    needs: [filter, build-macos-debug-clang-aarch64]
156    if: needs.filter.outputs.should-run == 'true'
157    uses: ./.github/workflows/ci-slang-test.yml
158    with:
159      os: macos
160      compiler: clang
161      platform: aarch64
162      config: debug
163      runs-on: '["macos-latest"]'
164      test-category: smoke
165      server-count: 3
166
167  test-macos-release-clang-aarch64:
168    needs: [filter, build-macos-release-clang-aarch64]
169    if: needs.filter.outputs.should-run == 'true'
170    uses: ./.github/workflows/ci-slang-test.yml
171    with:
172      os: macos
173      compiler: clang
174      platform: aarch64
175      config: release
176      runs-on: '["macos-latest"]'
177      test-category: full
178      full-gpu-tests: true
179      server-count: 3
180
181  # Windows GPU tests (self-hosted)
182  test-windows-debug-cl-x86_64-gpu:
183    needs: [filter, build-windows-debug-cl-x86_64-gpu]
184    if: needs.filter.outputs.should-run == 'true'
185    uses: ./.github/workflows/ci-slang-test.yml
186    with:
187      os: windows
188      compiler: cl
189      platform: x86_64
190      config: debug
191      runs-on: '["Windows", "self-hosted", "GCP-T4"]'
192      test-category: full
193      full-gpu-tests: true
194
195  test-windows-release-cl-x86_64-gpu:
196    needs: [filter, build-windows-release-cl-x86_64-gpu]
197    if: needs.filter.outputs.should-run == 'true'
198    uses: ./.github/workflows/ci-slang-test.yml
199    with:
200      os: windows
201      compiler: cl
202      platform: x86_64
203      config: release
204      runs-on: '["Windows", "self-hosted", "GCP-T4"]'
205      test-category: full
206      full-gpu-tests: true
207
208  check-ci:
209    needs:
210      [
211        test-windows-release-cl-x86_64-gpu,
212        test-windows-debug-cl-x86_64-gpu,
213        test-macos-release-clang-aarch64,
214        test-macos-debug-clang-aarch64,
215        test-linux-release-gcc-x86_64,
216        test-linux-debug-gcc-x86_64,
217      ]
218    runs-on: ubuntu-latest
219    if: always() # Always run, even if dependencies fail
220    steps:
221      - name: Check CI Results
222        run: |
223          echo "=== CI Results Summary ==="
224          echo "Windows Release GPU: ${{ needs.test-windows-release-cl-x86_64-gpu.result }}"
225          echo "Windows Debug GPU: ${{ needs.test-windows-debug-cl-x86_64-gpu.result }}"
226          echo "macOS Release ARM64: ${{ needs.test-macos-release-clang-aarch64.result }}"
227          echo "macOS Debug ARM64: ${{ needs.test-macos-debug-clang-aarch64.result }}"
228          echo "Linux Release x64: ${{ needs.test-linux-release-gcc-x86_64.result }}"
229          echo "Linux Debug x64: ${{ needs.test-linux-debug-gcc-x86_64.result }}"
230
231          # Check if any required jobs failed (allow success or skipped)
232          if [[ "${{ needs.test-windows-release-cl-x86_64-gpu.result }}" == "failure" ]] || \
233             [[ "${{ needs.test-windows-debug-cl-x86_64-gpu.result }}" == "failure" ]] || \
234             [[ "${{ needs.test-macos-release-clang-aarch64.result }}" == "failure" ]] || \
235             [[ "${{ needs.test-macos-debug-clang-aarch64.result }}" == "failure" ]] || \
236             [[ "${{ needs.test-linux-release-gcc-x86_64.result }}" == "failure" ]] || \
237             [[ "${{ needs.test-linux-debug-gcc-x86_64.result }}" == "failure" ]] || \
238             [[ "${{ needs.test-windows-release-cl-x86_64-gpu.result }}" == "cancelled" ]] || \
239             [[ "${{ needs.test-windows-debug-cl-x86_64-gpu.result }}" == "cancelled" ]] || \
240             [[ "${{ needs.test-macos-release-clang-aarch64.result }}" == "cancelled" ]] || \
241             [[ "${{ needs.test-macos-debug-clang-aarch64.result }}" == "cancelled" ]] || \
242             [[ "${{ needs.test-linux-release-gcc-x86_64.result }}" == "cancelled" ]] || \
243             [[ "${{ needs.test-linux-debug-gcc-x86_64.result }}" == "cancelled" ]]; then
244            echo "❌ One or more CI jobs failed or were cancelled"
245            exit 1
246          fi
247
248          echo "✅ All CI jobs completed successfully (passed or skipped)!"