forked from microsoft/DirectXShaderCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (169 loc) · 6.32 KB
/
main.yml
File metadata and controls
186 lines (169 loc) · 6.32 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
name: Devsh - Build & Deploy DXCompiler
on:
workflow_dispatch:
inputs:
COMMIT_SHA:
description: 'Commit SHA to build'
required: true
jobs:
windows:
name: Windows Build
runs-on: windows-2022
env:
HLSL_SRC_DIR: ${{ github.workspace }}
HLSL_BLD_DIR: "${{ github.workspace }}\\build"
platform: x64
os: windows-latest
COMMIT_SHA: ${{ github.event.inputs.COMMIT_SHA }}
strategy:
matrix:
configuration: [Release, Debug]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.COMMIT_SHA }}
clean: true
submodules: true
- name: Build
run: |
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
call utils\hct\hctbuild.cmd -${{ env.platform }} -${{ matrix.configuration }} -show-cmake-log -spirvtest
shell: cmd
- name: CMake Install DXCompiler
run: |
cmake --install build/include/dxc --prefix build/install --config ${{ matrix.configuration }}
cmake --install build/tools/clang/tools/dxcompiler --prefix build/install --config ${{ matrix.configuration }}
cmake -E copy build/${{ matrix.configuration }}/bin/dxcompiler.pdb build/install/lib/
cmake -E copy build/${{ matrix.configuration }}/bin/dxc.exe build/install/bin/
cmake -E copy include/dxc/WinAdapter.h build/install/include/dxc/
shell: cmd
- name: Archive Installed Directory
run: cmake -E tar czf ${{ github.event.inputs.COMMIT_SHA }}.tar.gz build/install
shell: cmd
- name: Upload Installed Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.os }}-${{ matrix.configuration }}-${{ github.event.inputs.COMMIT_SHA }}
path: ${{ github.event.inputs.COMMIT_SHA }}.tar.gz
nix:
name: Unix and macOS Build
strategy:
matrix:
include:
- os: ubuntu-latest
name: Linux_Clang_Release
configuration: Release
CC: clang-18
CXX: clang++-18
CMAKE_OPTS: "-DLLVM_ENABLE_WERROR=On -DLLVM_USE_LINKER=lld"
- os: ubuntu-latest
name: Linux_Clang_Debug
configuration: Debug
CC: clang
CXX: clang++
CMAKE_OPTS: "-DLLVM_ENABLE_WERROR=On -DLLVM_USE_LINKER=lld"
- os: macos-latest
name: MacOS_Clang_Release
configuration: Release
CC: clang
CXX: clang++
CMAKE_OPTS: "-DLLVM_ENABLE_WERROR=On"
- os: macos-latest
name: MacOS_Clang_Debug
configuration: Debug
CC: clang
CXX: clang++
CMAKE_OPTS: "-DLLVM_ENABLE_WERROR=On"
runs-on: ${{ matrix.os }}
env:
COMMIT_SHA: ${{ github.event.inputs.COMMIT_SHA }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.COMMIT_SHA }}
clean: true
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies on Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y libc++-18-dev
- name: Install dependencies on macOS
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew update
brew install ninja
ulimit -Sn 1024
- name: Configure with CMake
run: |
cmake -B build -G Ninja $GITHUB_WORKSPACE \
-DLLVM_LIT_ARGS="-v --xunit-xml-output=testresults.xunit.xml" \
-C $GITHUB_WORKSPACE/cmake/caches/PredefinedParams.cmake \
-DSPIRV_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=${{ matrix.configuration }} \
-DCMAKE_C_COMPILER=${{ matrix.CC }} \
-DCMAKE_CXX_COMPILER=${{ matrix.CXX }} \
${{ matrix.CMAKE_OPTS || '' }}
- name: Build
run: ninja -C build test-depends
- name: CMake Install DXCompiler
run: |
cmake --install build/include/dxc --prefix build/install --config ${{ matrix.configuration }}
cmake --install build/tools/clang/tools/dxcompiler --prefix build/install --config ${{ matrix.configuration }}
cmake -E copy include/dxc/WinAdapter.h build/install/include/dxc/
- name: Archive Installed Directory
run: cmake -E tar czf ${{ github.event.inputs.COMMIT_SHA }}.tar.gz build/install
- name: Upload Installed Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.configuration }}-${{ github.event.inputs.COMMIT_SHA }}
path: ${{ github.event.inputs.COMMIT_SHA }}.tar.gz
windows-tests:
name: Windows Devsh DXC smoke tests
needs: windows
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
env:
os: windows-latest
COMMIT_SHA: ${{ github.event.inputs.COMMIT_SHA }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.COMMIT_SHA }}
fetch-depth: 1
sparse-checkout: |
unittests
- name: Download DXCompiler artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.os }}-${{ matrix.configuration }}-${{ github.event.inputs.COMMIT_SHA }}
path: artifacts
- name: Unpack DXCompiler into unittests\Devsh\install
run: |
cmake -E tar xzf artifacts\${{ github.event.inputs.COMMIT_SHA }}.tar.gz
cmake -E make_directory unittests\Devsh\install
cmake -E copy_directory build\install unittests\Devsh\install
shell: cmd
- name: Configure Devsh unit tests
run: |
cmake -S unittests\Devsh -B unittests\Devsh\build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
shell: cmd
- name: Run Devsh DXC smoke tests
run: |
ctest -C ${{ matrix.configuration }} -VV -R dxc_smoke --output-on-failure
working-directory: unittests\Devsh\build
shell: cmd