Add more test textures #1619
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |