-
Notifications
You must be signed in to change notification settings - Fork 1
147 lines (130 loc) · 5.92 KB
/
test-volumetric-path-tracing.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
name: Test volumetric path tracing renderers
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
name: "${{ github.workflow }}"
env:
sgl_REPO_DIR: ${{ github.workspace }}/sgl-repo
sgl_DIR: ${{ github.workspace }}/sgl
swiftshader_DIR: ${{ github.workspace }}/swiftshader
swiftshader_COMMIT_ID: de870ac7518fe2b6bb651ecc22fc36647cf7b986
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/checkout@v2
with:
repository: chrismile/sgl
path: sgl-repo
submodules: true
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install git cmake libglm-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
libpng-dev libboost-filesystem-dev libtinyxml2-dev libarchive-dev libglew-dev libjsoncpp-dev libeigen3-dev \
python3-dev libzmq3-dev libnetcdf-dev libgtest-dev
- name: Install Vulkan SDK
shell: bash
run: |
distro_code_name=$(lsb_release -cs)
distro_release=$(lsb_release -rs)
os_arch="$(uname -m)"
if ! curl -s -I "https://packages.lunarg.com/vulkan/dists/${distro_code_name}/" | grep "2 404" > /dev/null; then
echo "Installing Vulkan SDK from a PPA..."
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-${distro_code_name}.list \
https://packages.lunarg.com/vulkan/lunarg-vulkan-${distro_code_name}.list
sudo apt update
sudo apt install -y vulkan-sdk shaderc glslang-dev
elif dpkg --compare-versions "$distro_release" "ge" "24.04"; then
sudo apt install -y libvulkan-dev libshaderc-dev glslang-dev
else
echo "Unpacking Vulkan SDK from an archive file..."
curl --silent --show-error --fail -O https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.tar.gz
mkdir -p VulkanSDK
tar -xf vulkan-sdk.tar.gz -C VulkanSDK
# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
if [ -f $shaderc_pkgconfig_file ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
fi
fi
- name: Configure CMake (sgl)
run: |
if [ "${{env.PKG_CONFIG_PATH}}" != "" ]; then
VK_LAYER_PATH=""
source "VulkanSDK/$(ls VulkanSDK)/setup-env.sh"
export PKG_CONFIG_PATH="${{env.PKG_CONFIG_PATH}}"
else
export VULKAN_SDK="/usr"
fi
cmake ${{env.sgl_REPO_DIR}} -B ${{env.sgl_REPO_DIR}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.sgl_DIR}}
- name: Build (sgl)
run: cmake --build ${{env.sgl_REPO_DIR}}/build --config ${{env.BUILD_TYPE}} --parallel 4
- name: Install (sgl)
run: cmake --build ${{env.sgl_REPO_DIR}}/build --config ${{env.BUILD_TYPE}} --target install
- name: Configure CMake (CloudRendering)
run: |
if [ "${{env.PKG_CONFIG_PATH}}" != "" ]; then
VK_LAYER_PATH=""
source "VulkanSDK/$(ls VulkanSDK)/setup-env.sh"
export PKG_CONFIG_PATH="${{env.PKG_CONFIG_PATH}}"
else
export VULKAN_SDK="/usr"
fi
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -Dsgl_DIR=${{env.sgl_DIR}}/lib/cmake/sgl -DUSE_GTEST=On
- name: Build (CloudRendering)
run: |
if [ "${{env.PKG_CONFIG_PATH}}" != "" ]; then
VK_LAYER_PATH=""
source "VulkanSDK/$(ls VulkanSDK)/setup-env.sh"
export PKG_CONFIG_PATH="${{env.PKG_CONFIG_PATH}}"
else
export VULKAN_SDK="/usr"
fi
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 4
- name: Cache SwiftShader binaries
id: cache-swiftshader
uses: actions/cache@v4
with:
path: ${{env.swiftshader_DIR}}
key: ${{runner.os}}-swiftshader-${{env.BUILD_TYPE}}-${{env.swiftshader_COMMIT_ID}}
- name: Build (SwiftShader)
if: steps.cache-swiftshader.outputs.cache-hit != 'true'
run: |
git clone https://github.com/google/swiftshader.git ${{env.swiftshader_DIR}}
git -C ${{env.swiftshader_DIR}} checkout ${{env.swiftshader_COMMIT_ID}}
git -C ${{env.swiftshader_DIR}} submodule update --init
cmake ${{env.swiftshader_DIR}} -B ${{env.swiftshader_DIR}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ${{env.swiftshader_DIR}}/build --config ${{env.BUILD_TYPE}} --parallel 4
- name: Run tests
id: tests
run: |
echo "USER=$USER" >> $GITHUB_ENV
#export LD_LIBRARY_PATH="${{env.swiftshader_DIR}}/build/Linux"
export VK_ICD_FILENAMES="${{env.swiftshader_DIR}}/build/Linux/vk_swiftshader_icd.json"
if [ "${{env.PKG_CONFIG_PATH}}" != "" ]; then
VK_LAYER_PATH=""
source "VulkanSDK/$(ls VulkanSDK)/setup-env.sh"
fi
mkdir -p ${{github.workspace}}/Data/CloudDataSets/env_maps
wget -O ${{github.workspace}}/Data/CloudDataSets/env_maps/small_empty_room_1_1k.exr https://dl.polyhaven.org/file/ph-assets/HDRIs/exr/1k/small_empty_room_1_1k.exr
${{github.workspace}}/build/CloudRendering_test
- name: Archive logs and failure case images
if: always() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: vpt-output-images
path: |
/home/${{env.USER}}/.config/cloud-rendering/Logfile.html
${{github.workspace}}/build/*.png