Skip to content

Revert tests to headless integration #99

Revert tests to headless integration

Revert tests to headless integration #99

name: CMake Build & Test
on:
push:
branches: [ "**" ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Download submodules
run: |
git submodule update --init --recursive
cd 3rd/vk-bootstrap
git checkout fd71b1dd8227bb122c110c0d30836ab7ec1c089a
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build build-essential gcc libvulkan-dev libvulkan1 vulkan-tools vulkan-utility-libraries-dev mesa-vulkan-drivers python3-pip
pip3 install gcovr
- name: Configure CMake
run: cmake -S . -B build -G Ninja -DSDL_UNIX_CONSOLE_BUILD=ON -DBUILD_SAMPLE_APP=ON -DBUILD_TESTS=ON -DBUILD_WITH_COVERAGE=ON
- name: Build
run: |
cmake --build build --config Release
- name: Run tests
run: |
export LD_LIBRARY_PATH=${{ github.workspace }}/build/SDL3:$LD_LIBRARY_PATH
ctest --test-dir build/tests --output-on-failure
- name: Get coverage data
run: |
gcovr -r . --object-directory build --exclude 3rd/ --exclude test-app/
total=$(gcovr -r . --object-directory build --exclude 3rd/ --exclude test-app/ | grep TOTAL | awk '{print $4}')
echo "TOTAL_COVERAGE=$total" >> $GITHUB_ENV
- name: Create Awesome Badge
if: github.ref == 'refs/heads/main'
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: 227fdd0e548061bf552b6fe1e51b14d4
filename: test.svg
label: Coverage
message: ${{ env.TOTAL_COVERAGE }}
color: green