This commit is contained in:
25
.gitea/workflows/test.yaml
Normal file
25
.gitea/workflows/test.yaml
Normal file
@@ -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 -DKATJA_BUILD_TUI=Off
|
||||||
|
ninja -C build
|
||||||
|
- name: Run tests
|
||||||
|
run: ninja -C build test
|
@@ -2,12 +2,14 @@
|
|||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# 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/.
|
# 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)
|
project(Katja LANGUAGES CXX)
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
|
option(KATJA_BUILD_TUI "Build text user interface" ON)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
@@ -20,7 +22,9 @@ add_library(katja
|
|||||||
)
|
)
|
||||||
include_directories(include ${Boost_INCLUDE_DIR})
|
include_directories(include ${Boost_INCLUDE_DIR})
|
||||||
|
|
||||||
add_subdirectory(cli)
|
if(KATJA_BUILD_TUI)
|
||||||
|
add_subdirectory(cli)
|
||||||
|
endif()
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -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`.
|
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
|
## Project structure
|
||||||
|
|
||||||
The library code is in `katja/`. Public headers are under `include/`.
|
The library code is in `katja/`. Public headers are under `include/`.
|
||||||
|
@@ -9,16 +9,12 @@ FetchContent_Declare(ftxui
|
|||||||
GIT_SHALLOW TRUE
|
GIT_SHALLOW TRUE
|
||||||
EXCLUDE_FROM_ALL
|
EXCLUDE_FROM_ALL
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(ftxui)
|
|
||||||
|
|
||||||
FetchContent_Declare(toml11
|
FetchContent_Declare(toml11
|
||||||
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
|
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
|
||||||
GIT_TAG v4.4.0
|
GIT_TAG v4.4.0
|
||||||
GIT_PROGRESS TRUE
|
GIT_PROGRESS TRUE
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(toml11)
|
FetchContent_MakeAvailable(ftxui toml11)
|
||||||
|
|
||||||
set(FTXUI_BUILD_MODULES ON)
|
|
||||||
|
|
||||||
add_executable(katja-cli main.cpp)
|
add_executable(katja-cli main.cpp)
|
||||||
target_sources(katja-cli PUBLIC FILE_SET all_my_modules TYPE CXX_MODULES FILES
|
target_sources(katja-cli PUBLIC FILE_SET all_my_modules TYPE CXX_MODULES FILES
|
||||||
|
Reference in New Issue
Block a user