Skip to content

Merge pull request #8 from Kataglyphis/develop #333

Merge pull request #8 from Kataglyphis/develop

Merge pull request #8 from Kataglyphis/develop #333

Workflow file for this run

name: Linux build + test + coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install GLFW + build system dependencies
run: |
sudo apt-get install -y \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
libglu1-mesa-dev \
freeglut3-dev \
mesa-common-dev \
mesa-utils \
wayland-protocols \
libwayland-dev \
libxkbcommon-dev \
libglx-mesa0 \
ninja-build \
ccache \
iwyu
- name: Install for Offscreen Rendering on GLFW
run: sudo apt-get install libosmesa6-dev
- name: Prepare python env for sphynx
run: |
pip install -r requirements.txt
- name: Create docs
run: |
cd docs
make html
- name: 📂 Sync files to dev domain
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.SERVER }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PW }}
local-dir: "./docs/build/html/"
- name: Install Vulkan
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list
sudo apt update
sudo apt install vulkan-sdk
- name: Install Code Coverage dependencies
run: sudo apt-get install -y gcovr
- name: Install clang
run: sudo apt-get install clang llvm
- name: Make directory
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
# cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGLFW_USE_OSMESA=ON
run: |
rm -rf build
mkdir build
- name: Build
# Build your program with the given configuration
run: |
cd build
cmake --preset linux-debug-clang ..
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build/
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} --verbose --extra-verbose --debug -T test --output-on-failure -E Integration.VulkanEngine RendererTest.BasicSetup
- name: Build Code Coverage
run: |
llvm-profdata merge -sparse ${{github.workspace}}/build/Test/compile/default.profraw -o ${{github.workspace}}/build/compileTestSuite.profdata
llvm-cov report ${{github.workspace}}/build/compileTestSuite -instr-profile=${{github.workspace}}/build/compileTestSuite.profdata
llvm-cov export ${{github.workspace}}/build/compileTestSuite -format=text -instr-profile=${{github.workspace}}/build/compileTestSuite.profdata > ${{github.workspace}}/build/coverage.json
# - name: Run profiling
# run: |
# cd build
# LLVM_PROFILE_FILE="${{github.workspace}}/build/engine.profraw" ./GraphicsEngine
# llvm-profdata merge -sparse ${{github.workspace}}/build/engine.profraw -o ${{github.workspace}}/build/engine.profdata
# llvm-cov show ./GraphicsEngine -instr-profile=${{github.workspace}}/build/engine.profdata -format=text
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ${{github.workspace}}/build/coverage.json # optional
#flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: false # optional (default = false)
verbose: false # optional (default = false)