-
Notifications
You must be signed in to change notification settings - Fork 31
204 lines (202 loc) · 6.53 KB
/
build-and-test-callable.yaml
File metadata and controls
204 lines (202 loc) · 6.53 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: HLSL Test
permissions:
contents: read
on:
workflow_dispatch:
inputs:
OffloadTest-branch:
description: 'Test Suite Branch'
required: false
default: 'main'
type: string
LLVM-branch:
description: 'LLVM Branch'
required: false
default: 'main'
type: string
LLVM-fork:
description: 'LLVM fork'
required: false
default: 'llvm'
type: string
DXC-branch:
description: 'DXC Branch'
required: false
default: 'main'
type: string
BuildType:
description: 'Build Type'
required: false
default: 'RelWithDebInfo'
type: choice
options:
- Release
- RelWithDebInfo
- Debug
TestTarget:
required: false
default: 'check-hlsl'
type: string
OS:
required: true
type: choice
options:
- macOS
- windows
SKU:
required: true
type: choice
options:
- macos
- windows-amd
- windows-intel
- windows-nvidia
LLVM-ExtraCMakeArgs:
description: 'Extra CMake Args for LLVM'
required: false
default: ''
type: string
TestTargetReconvergence:
required: false
default: 'check-hlsl-reconvergence'
type: string
workflow_call:
inputs:
OffloadTest-branch:
description: 'Test Suite Branch'
required: false
default: 'main'
type: string
LLVM-branch:
description: 'LLVM Branch'
required: false
default: 'main'
type: string
LLVM-fork:
description: 'LLVM For'
required: false
default: 'llvm'
type: string
DXC-branch:
description: 'DXC Branch'
required: false
default: 'main'
type: string
OS:
required: true
type: string
SKU:
required: true
type: string
BuildType:
description: 'Build Config'
required: false
default: 'RelWithDebInfo'
type: string
TestTarget:
required: false
default: 'check-hlsl'
type: string
LLVM-ExtraCMakeArgs:
description: 'Extra CMake Args for LLVM'
required: false
default: ''
type: string
TestTargetReconvergence:
required: false
default: 'check-hlsl-reconvergence'
type: string
jobs:
build:
permissions:
checks: write
runs-on: [self-hosted, "hlsl-${{ inputs.SKU }}"]
steps:
- name: Checkout DXC
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: Microsoft/DirectXShaderCompiler
ref: ${{ inputs.DXC-branch }}
path: DXC
fetch-depth: 1
submodules: true
- name: Checkout LLVM
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: ${{ inputs.LLVM-fork }}/llvm-project
ref: ${{ inputs.LLVM-branch }}
path: llvm-project
fetch-depth: 1
- name: Checkout OffloadTest
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: llvm/offload-test-suite
ref: ${{ inputs.OffloadTest-branch }}
path: OffloadTest
fetch-depth: 1
- name: Checkout Golden Images
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: llvm/offload-golden-images
ref: main
path: golden-images
fetch-depth: 1
- name: Setup Windows x64
if: inputs.OS == 'windows' && runner.arch != 'ARM64'
uses: llvm/actions/setup-windows@89a8cf80982d830faab019237860b344a6390c30 # main
with:
arch: amd64
- name: Setup Windows
if: inputs.OS == 'windows' && runner.arch == 'ARM64'
uses: llvm/actions/setup-windows@89a8cf80982d830faab019237860b344a6390c30 # main
with:
arch: arm64
- name: Detect Clang
id: Test-Clang
shell: bash
if: contains(inputs.TestTarget, 'clang')
run: echo TEST_CLANG=On >> $GITHUB_OUTPUT
- name: Build DXC
run: |
cd DXC
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/DXC/cmake/caches/PredefinedParams.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DHLSL_DISABLE_SOURCE_GENERATION=On ${{ github.workspace }}/DXC/
ninja
- name: Build LLVM
run: |
cd llvm-project
mkdir build
cd build
cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/
ninja hlsl-test-depends
- name: Dump GPU Info
run: |
cd llvm-project
cd build
./bin/api-query
- name: Run HLSL Tests
run: |
cd llvm-project
cd build
ninja check-hlsl-unit
ninja ${{ inputs.TestTarget }}
- name: Run Maximal Reconvergence Tests
if: always()
continue-on-error: true
run: |
cd llvm-project
cd build
ninja ${{ inputs.TestTargetReconvergence }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/macos@34d7c956a59aed1bfebf31df77b8de55db9bbaaf # v2.21.0
if: always() && inputs.OS == 'macOS'
with:
comment_mode: off
files: llvm-project/build/**/testresults.xunit.xml
#- name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action/windows@34d7c956a59aed1bfebf31df77b8de55db9bbaaf # v2.21.0
# if: always() && inputs.OS == 'windows'
# with:
# comment_mode: off
# files: llvm-project/build/**/testresults.xunit.xml