Skip to content

Commit

Permalink
improvement: added test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
BartSte committed Dec 30, 2023
1 parent 3e2b24a commit ef71d0e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang ninja-build git cmake qt6-base-dev qt6-multimedia-dev libboost-all-dev libspdlog-dev libcxxopts-dev libgl1-mesa-dev
- name: Build project
env:
CC: clang
CXX: clang++
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake --build build
- name: Run tests
run: |
./build/bin/tests
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option(BUILD_TESTS "Build tests" OFF)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Build tests: ${BUILD_TESTS}")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
Expand All @@ -19,6 +19,19 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
message(STATUS "Submodule update")
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with
${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()

configure_file(${CMAKE_SOURCE_DIR}/include/version.h.in
${CMAKE_SOURCE_DIR}/include/version.h @ONLY)

Expand Down
1 change: 0 additions & 1 deletion src/helpers/time.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <helpers/time.hpp>

#include <algorithm>
#include <bits/chrono.h>
#include <chrono>
#include <iostream>
#include <map>
Expand Down

0 comments on commit ef71d0e

Please sign in to comment.