Skip to content

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:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# - name: Update system and adding toolchain
# run: |
# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
# sudo apt update
# sudo apt upgrade
# sudo apt dist-upgrade
# sudo apt install libc6
- 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: 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 SetUp.blob
- 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: 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)