-
Notifications
You must be signed in to change notification settings - Fork 85
146 lines (130 loc) · 5.35 KB
/
workflow.yml
File metadata and controls
146 lines (130 loc) · 5.35 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
name: CMake CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
vulkan-install: |
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt-get update
sudo apt-get install -y vulkan-sdk
deps-install: |
sudo apt-get update
sudo apt-get install -y \
libglfw3-dev \
libglm-dev \
libtinyobjloader-dev \
libstb-dev
test-cmd: |
# Check if some of the expected executables were built
if [ -f "00_base_code/00_base_code" ]; then
echo "00_base_code built successfully"
else
echo "00_base_code build failed"
exit 1
fi
if [ -f "15_hello_triangle/15_hello_triangle" ]; then
echo "15_hello_triangle built successfully"
else
echo "15_hello_triangle build failed"
exit 1
fi
if [ -f "31_compute_shader/31_compute_shader" ]; then
echo "31_compute_shader built successfully"
else
echo "31_compute_shader build failed"
exit 1
fi
- os: windows-latest
vulkan-install: |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe" -OutFile "$env:TEMP\vulkan-sdk.exe"
Start-Process -FilePath "$env:TEMP\vulkan-sdk.exe" -ArgumentList "--accept-licenses --default-answer --confirm-command install" -Wait
echo "VULKAN_SDK=$env:VULKAN_SDK" >> $env:GITHUB_ENV
deps-install: |
vcpkg install glfw3:x64-windows glm:x64-windows tinyobjloader:x64-windows stb:x64-windows
echo "CMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV
test-cmd: |
# Check if some of the expected executables were built
if (Test-Path "00_base_code/Release/00_base_code.exe") {
echo "00_base_code built successfully"
} else {
echo "00_base_code build failed"
exit 1
}
if (Test-Path "15_hello_triangle/Release/15_hello_triangle.exe") {
echo "15_hello_triangle built successfully"
} else {
echo "15_hello_triangle build failed"
exit 1
}
if (Test-Path "31_compute_shader/Release/31_compute_shader.exe") {
echo "31_compute_shader built successfully"
} else {
echo "31_compute_shader build failed"
exit 1
}
- os: macos-latest
vulkan-install: |
brew install molten-vk
curl -L -o vulkansdk.dmg "https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg"
hdiutil attach vulkansdk.dmg
sudo /Volumes/vulkansdk/InstallVulkan.app/Contents/MacOS/InstallVulkan --accept-licenses --default-answer --confirm-command install
hdiutil detach /Volumes/vulkansdk
deps-install: |
brew install glfw glm tinyobjloader stb
test-cmd: |
# Check if some of the expected executables were built
if [ -f "00_base_code/00_base_code" ]; then
echo "00_base_code built successfully"
else
echo "00_base_code build failed"
exit 1
fi
if [ -f "15_hello_triangle/15_hello_triangle" ]; then
echo "15_hello_triangle built successfully"
else
echo "15_hello_triangle build failed"
exit 1
fi
if [ -f "31_compute_shader/31_compute_shader" ]; then
echo "31_compute_shader built successfully"
else
echo "31_compute_shader build failed"
exit 1
fi
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.vcpkg
~/Library/Caches/Homebrew
${{ env.VCPKG_INSTALLATION_ROOT }}
key: ${{ runner.os }}-deps-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-deps-
- name: Install dependencies
run: ${{ matrix.deps-install }}
- name: Install Vulkan SDK
run: ${{ matrix.vulkan-install }}
- name: Configure CMake
working-directory: ${{github.workspace}}/attachments
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{github.workspace}}/attachments
run: cmake --build build --config Release
- name: Test Build Output
working-directory: ${{github.workspace}}/attachments/build
run: ${{ matrix.test-cmd }}