-
Notifications
You must be signed in to change notification settings - Fork 37
82 lines (73 loc) · 3.34 KB
/
linux-build.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
name: Linux build
on:
pull_request:
# Cancel previous runs if a more recent commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions: read-all
jobs:
linux-build:
name: Build and run tests on Linux
runs-on: "ubuntu-20.04"
steps:
- name: Setup necessary packages
run: |
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo apt update && sudo apt install libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libx11-xcb-dev clang \
mesa-vulkan-drivers
- name: Setup Vulkan SDK
run: |
wget -q https://sdk.lunarg.com/sdk/download/1.3.268.0/linux/vulkansdk-linux-x86_64-1.3.268.0.tar.xz
if ! echo "d23343736247828ff5b3b6b1b7fd83a72b5df1a54b2527ae3663cebdfee75842 vulkansdk-linux-x86_64-1.3.268.0.tar.xz" | sha256sum -c --status; then
echo "Invalid SHA256 for VulkanSDK's binary. Aborting."
exit 1
fi
mkdir "${HOME}/vulkan-sdk"
tar -xf vulkansdk-linux-x86_64-1.3.268.0.tar.xz -C "${HOME}/vulkan-sdk"
echo "VULKAN_SDK=${HOME}/vulkan-sdk/1.3.268.0/x86_64" >> $GITHUB_ENV
echo "VK_LAYER_PATH=${HOME}/vulkan-sdk/1.3.268.0/x86_64/etc/vulkan/explicit_layer.d" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${HOME}/vulkan-sdk/1.3.268.0/x86_64/lib" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Switch to pull request branch and clone submodules
run: |
git checkout ${GITHUB_SHA}
git submodule update --init --recursive
- name: Build without XR support
run: |
mkdir build_no_xr
cd build_no_xr
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DPPX_BUILD_TESTS=ON -DPPX_BUILD_XR=0 -DCMAKE_BUILD_TYPE=Debug
make -j $(nproc)
- name: Build with XR support
run: |
mkdir build
cd build
# -DBUILD_TESTS=OFF only disables the OpenXR tests
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DPPX_BUILD_TESTS=ON -DPPX_BUILD_XR=1 -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug
make -j $(nproc)
- name: Run unit tests
run: |
cd build
ctest -j $(nproc)
- name: Run runtime tests
run: |
cd build/bin
xvfb-run -a ./vk_sample_03_square_textured --frame-count 2 --screenshot-frame-number 1
convert screenshot_frame_1.ppm vk_03_square_textured_screenshot.png
xvfb-run -a ./vk_sample_09_obj_geometry --frame-count 2 --screenshot-frame-number 1
convert screenshot_frame_1.ppm vk_09_obj_geometry_screenshot.png
xvfb-run -a ./vk_sample_13_normal_map --frame-count 2 --screenshot-frame-number 1
convert screenshot_frame_1.ppm vk_13_normal_map_screenshot.png
xvfb-run -a ./vk_fishtornado --frame-count 2 --screenshot-frame-number 1
convert screenshot_frame_1.ppm vk_fishtornado_screenshot.png
xvfb-run -a ./vk_graphics_pipeline --frame-count 2 --screenshot-frame-number 1
convert screenshot_frame_1.ppm vk_graphics_pipeline_screenshot.png
- name: Upload screenshots
uses: actions/upload-artifact@v3
with:
name: screenshots
path: build/bin/*.png