-
Notifications
You must be signed in to change notification settings - Fork 31
169 lines (137 loc) · 5.2 KB
/
CI.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
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
name: CI
on:
# Run on the 2nd of every month, at 10AM UTC
schedule:
- cron: '0 10 2 * *'
# Run the workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
env:
PREMAKE_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2
VULKAN_URL: https://sdk.lunarg.com/sdk/download
VULKAN_VERSION: "1.3.250.1"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
premake-opts: gmake2
- os: windows-2019
premake-opts: vs2019
- os: macos-11
premake-opts: gmake2
runs-on: ${{ matrix.os }}
steps:
- name: Clone code repository
uses: actions/checkout@v2
- name: Dependencies for Ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
working-directory: ${{github.workspace}}
run: |
sudo apt-get update -y && sudo apt-get install -yq xorg-dev libgtk-3-dev
wget -O premake.tar.gz ${PREMAKE_URL}-linux.tar.gz
tar -xzf premake.tar.gz
- name: Dependencies for macOS
if: startsWith(matrix.os, 'macos')
shell: bash
working-directory: ${{github.workspace}}
run: |
brew install wget
wget -O premake.tar.gz ${PREMAKE_URL}-macosx.tar.gz
tar -xzf premake.tar.gz
- name: Dependencies for Windows
if: startsWith(matrix.os, 'windows')
shell: bash
working-directory: ${{github.workspace}}
run: |
choco install wget
wget -O premake.zip ${PREMAKE_URL}-windows.zip
7z e premake.zip
- name: Cache Vulkan
id: cache
uses: actions/cache@v2
with:
path: ${{github.workspace}}/vulkansdk
key: ${{ runner.os }}-vulkansdk-${{ env.VULKAN_VERSION }}
- name: Vulkan for Ubuntu
if: startsWith(matrix.os, 'ubuntu') && (steps.cache.outputs.cache-hit != 'true')
shell: bash
working-directory: ${{github.workspace}}
run: |
wget -O vulkansdk.tar.gz ${VULKAN_URL}/${VULKAN_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_VERSION}.tar.gz
mkdir vulkansdk && tar -xf vulkansdk.tar.gz -C vulkansdk --strip-components=1
- name: Vulkan for macOS
if: startsWith(matrix.os, 'macos') && (steps.cache.outputs.cache-hit != 'true')
shell: bash
working-directory: ${{github.workspace}}
run: |
wget -O vulkansdk.dmg ${VULKAN_URL}/${VULKAN_VERSION}/mac/vulkansdk-macos-${VULKAN_VERSION}.dmg
hdiutil attach vulkansdk.dmg
/Volumes/VulkanSDK/InstallVulkan.app/Contents/MacOS/InstallVulkan --root `pwd`/vulkansdk/ --accept-licenses --default-answer --confirm-command install copy_only=1
hdiutil detach /Volumes/VulkanSDK
mv vulkansdk/macOS vulkansdk/x86_64
- name: Vulkan for Windows
if: startsWith(matrix.os, 'windows') && (steps.cache.outputs.cache-hit != 'true')
shell: bash
working-directory: ${{github.workspace}}
run: |
wget -O vulkansdk.exe ${VULKAN_URL}/${VULKAN_VERSION}/windows/VulkanSDK-${VULKAN_VERSION}-Installer.exe
7z x -aoa ./vulkansdk.exe -ovulkansdk
- name: Generate projects
working-directory: ${{github.workspace}}
shell: bash
run: |
./premake5 ${{matrix.premake-opts}} --skip_shader_validation --env_vulkan_sdk
- name: Build using Make
if: ${{matrix.premake-opts == 'gmake2' }}
working-directory: ${{github.workspace}}
shell: bash
run: |
export VULKAN_SDK=`pwd`/vulkansdk/x86_64
cd build
make ALL
- name: Build using MSVC
if: ${{matrix.premake-opts == 'vs2019' }}
working-directory: ${{github.workspace}}
shell: cmd
run: |
set VULKAN_SDK=%cd%\vulkansdk
cd build
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" .\Rendu.sln -t:Meta\ALL -nologo -v:minimal -p:Configuration=Release -p:Platform=x64
- name: Upload shader validator
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: shader-validator-${{matrix.os}}
path: |
${{ github.workspace }}/build/ShaderValidator/Release/ShaderValidator.exe
${{ github.workspace }}/build/ShaderValidator/Release/ShaderValidator
retention-days: 1
validate_shaders:
needs: build
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
premake-opts: gmake2
- os: windows-2019
premake-opts: vs2019
- os: macos-11
premake-opts: gmake2
runs-on: ${{ matrix.os }}
steps:
- name: Clone code repository
uses: actions/checkout@v2
- name: Download shader validator
uses: actions/download-artifact@v2
with:
name: shader-validator-${{matrix.os}}
- name: Compile all shaders
working-directory: ${{github.workspace}}
shell: bash
run: |
chmod +x ShaderValidator
./ShaderValidator ./resources/