Skip to content

add build in CI

add build in CI #12

Workflow file for this run

name: Presubmit
on:
push:
branches:
- main
pull_request:
jobs:
format:
name: Check code formatting
runs-on: ubuntu-22.04
steps:
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format clang-format-15
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check format
run: |
git-clang-format --binary clang-format-15 --diff origin/main --extensions cpp,hpp > output.txt
cat output.txt
grep "no modified files to format" output.txt
build:
name: Build
needs: format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ninja-build libvulkan-dev
- name: Build SPIRV-Tools
run: |
git clone --depth 1 --branch vksp https://github.com/rjodinchr/SPIRV-Tools.git third_party/spirv-tools
git clone --depth 1 --branch vksp https://github.com/rjodinchr/SPIRV-Headers.git third_party/spirv-tools/external/spirv-headers
mkdir install
cmake -B third_party/spirv-tools/build -S third_party/spirv-tools/ -G Ninja -DCMAKE_INSTALL_PREFIX=install
cmake --build third_party/spirv-tools/build --target install
- name: Build Perfetto
run: |
git clone --depth 1 --branch v39.0 https://android.googlesource.com/platform/external/perfetto third_party/perfetto
$(pwd)/third_party/perfetto/tools/install-build-deps
$(pwd)/third_party/perfetto/tools/setup_all_configs.py
$(pwd)/third_party/perfetto/tools/ninja -C $(pwd)/third_party/perfetto/out/linux_clang_release libtrace_processor.a
- name: Build
run: |
cmake -B build -S . -G Ninja \
-DPERFETTO_SDK_PATH="$(pwd)/third_party/perfetto/sdk" \
-DPERFETTO_INTERNAL_INCLUDE_PATH="$(pwd)/third_party/perfetto/include" \
-DPERFETTO_TRACE_PROCESSOR_LIB="$(pwd)/third_party/perfetto/out/linux_clang_release/libtrace_processor.a" \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH};$(pwd)/install/lib/cmake/SPIRV-Tools/opt;$(pwd)/install/lib/cmake/SPIRV-Tools"
cmake --build build