-
Notifications
You must be signed in to change notification settings - Fork 3
119 lines (100 loc) · 4.07 KB
/
build-artifacts.yml
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
name: build-artifacts
on:
workflow_dispatch:
jobs:
Build:
strategy:
matrix:
os: [windows-2022, ubuntu-20.04, macOS-12]
sdkTag: ['vulkan-sdk-1.3.283.0', 'sdk-1.3.261.1']
include:
- os: windows-2022
swiftshaderLibName: vk_swiftshader.dll
- os: ubuntu-20.04
swiftshaderLibName: libvk_swiftshader.so
- os: macOS-12
swiftshaderLibName: libvk_swiftshader.dylib
name: 'Build vulkanCI-${{ matrix.sdkTag }}-${{ matrix.os }}-x64'
runs-on: ${{ matrix.os }}
steps:
- name: Print Inputs
shell: bash
run: echo "Requested VulkanSDK ${{ matrix.sdkTag }}"
- name: Setup MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y xorg-dev libwayland-dev
- name: Set up SDK path
shell: bash
run: |
ROOT_PATH='${{ github.workspace }}'
echo "SDK_PATH=${ROOT_PATH//\\//}/VulkanSDK/${{ matrix.sdkTag }}" >> $GITHUB_ENV
SDK_VERSION=$(echo "${{ matrix.sdkTag }}" | sed -E 's/[^0-9]*([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/')
echo "ARTIFACT_NAME=vulkanCI-$SDK_VERSION-${{ matrix.os }}-x64" >> $GITHUB_ENV
- name: Checkout Vulkan-Headers
uses: actions/checkout@v4
with:
repository: KhronosGroup/Vulkan-Headers
ref: '${{ matrix.sdkTag }}'
path: 'Vulkan-Headers'
- name: Build Vulkan-Headers
shell: bash
run: |
cmake -S Vulkan-Headers -B Vulkan-Headers/build
cmake --install Vulkan-Headers/build --prefix ${{ env.SDK_PATH }}
- name: Checkout Vulkan-Loader
uses: actions/checkout@v4
with:
repository: KhronosGroup/Vulkan-Loader
ref: '${{ inputs.sdkTag }}'
path: 'Vulkan-Loader'
- name: Build Vulkan-Loader
shell: bash
run: |
cmake -S Vulkan-Loader -B Vulkan-Loader/build -DVULKAN_HEADERS_INSTALL_DIR=${{ env.SDK_PATH }} -DLOADER_USE_UNSAFE_FILE_SEARCH=ON -DCMAKE_BUILD_TYPE=Release
cmake --build Vulkan-Loader/build --config Release --parallel 4
cmake --install Vulkan-Loader/build --prefix ${{ env.SDK_PATH }}
- name: Checkout Vulkan-ValidationLayers
uses: actions/checkout@v4
with:
repository: KhronosGroup/Vulkan-ValidationLayers
ref: '${{ inputs.sdkTag }}'
path: 'Vulkan-ValidationLayers'
- name: Build Vulkan-ValidationLayers
shell: bash
run: |
cmake -S Vulkan-ValidationLayers -B Vulkan-ValidationLayers/build -DUPDATE_DEPS=ON -DCMAKE_BUILD_TYPE=Release
cmake --build Vulkan-ValidationLayers/build --config Release --parallel 4
cmake --install Vulkan-ValidationLayers/build --prefix ${{ env.SDK_PATH }}
cp Vulkan-ValidationLayers/LICENSE.txt ${{ env.SDK_PATH }}
- name: Checkout Swiftshader
uses: actions/checkout@v4
with:
repository: NcStudios/swiftshader
ref: 'release'
path: 'Swiftshader'
submodules: 'recursive'
- name: Build Swiftshader
shell: bash
run: |
cmake -S Swiftshader -B Swiftshader/build_out -DCMAKE_BUILD_TYPE=Release
cmake --build Swiftshader/build_out --target vk_swiftshader --config Release --parallel 4
if [[ "${{ runner.os }}" == "Windows" ]]; then
OUT_DIR=Windows
elif [[ "${{ runner.os }}" == "Linux" ]]; then
OUT_DIR=Linux
elif [[ "${{ runner.os }}" == "macOS" ]]; then
OUT_DIR=Darwin
fi
mkdir ${{ env.SDK_PATH }}/swiftshader
cp Swiftshader/build_out/$OUT_DIR/${{ matrix.swiftshaderLibName }} ${{ env.SDK_PATH }}/swiftshader
cp Swiftshader/LICENSE.txt ${{ env.SDK_PATH }}/swiftshader
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: VulkanSDK