From a886e8931557f7f6f8d23b9219df0802956ee9d4 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 1 Aug 2025 21:18:16 +0200 Subject: [PATCH] Add a build action --- .gitea/workflows/test.yaml | 25 +++++++++++++++++++++++++ CMakeLists.txt | 2 +- README.md | 8 ++++++++ cli/CMakeLists.txt | 6 +----- 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 .gitea/workflows/test.yaml diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..d157ba0 --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,25 @@ +name: Test + +on: + push: + branches: + - '**' + pull_request: + branches: [master] + +jobs: + build: + runs-on: alpine + steps: + - name: Set up environment + shell: ash {0} + run: | + apk -U upgrade + apk add --no-cache git bash cmake build-base ninja-is-really-ninja boost-dev + - uses: actions/checkout@v4 + - name: Build + run: | + cmake -B build -G Ninja + ninja -C build + - name: Run tests + run: ninja -C build test diff --git a/CMakeLists.txt b/CMakeLists.txt index cdbe986..f51ba3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. -cmake_minimum_required(VERSION 4.0) +cmake_minimum_required(VERSION 3.30) project(Katja) include(CTest) diff --git a/README.md b/README.md index 4582401..41fb2fa 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,14 @@ Pass `-DCMAKE_BUILD_TYPE=Debug` or `-DCMAKE_BUILD_TYPE=Release` to This builds a CLI that can be then found in `./build/bin/katja`. +### Running the tests + +To run the tests follow the build instructions first and then do: + +```sh +ninja -C build test +``` + ## Project structure The library code is in `katja/`. Public headers are under `include/`. diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 1e7921d..100cfe2 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -9,16 +9,12 @@ FetchContent_Declare(ftxui GIT_SHALLOW TRUE EXCLUDE_FROM_ALL ) -FetchContent_MakeAvailable(ftxui) - FetchContent_Declare(toml11 GIT_REPOSITORY https://github.com/ToruNiina/toml11.git GIT_TAG v4.4.0 GIT_PROGRESS TRUE ) -FetchContent_MakeAvailable(toml11) - -set(FTXUI_BUILD_MODULES ON) +FetchContent_MakeAvailable(ftxui toml11) add_executable(katja-cli main.cpp) target_sources(katja-cli PUBLIC FILE_SET all_my_modules TYPE CXX_MODULES FILES