From 17159e67ecee4391cd0c8b7297a325a9c184a710 Mon Sep 17 00:00:00 2001 From: barts Date: Sat, 30 Dec 2023 15:43:19 +0100 Subject: [PATCH] improvement: added test pipeline --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 1 + 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b967d29 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +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++ + CXXFLAGS: -std=c++17 + run: | + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON + cmake --build build + + - name: Run tests + run: | + ./build/bin/tests diff --git a/CMakeLists.txt b/CMakeLists.txt index f30eef9..83b1da5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ message(STATUS "Build tests: ${BUILD_TESTS}") set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20") set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON)