Skip to content

Commit

Permalink
Merge branch 'main' into feature/chunk-data-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rozukke authored Jul 15, 2024
2 parents 2ba6311 + 6ed3d39 commit 6392ab5
Show file tree
Hide file tree
Showing 15 changed files with 822 additions and 128 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
branches: main
paths: ['**.cpp', '**.h', '**CMakeLists.txt']
pull_request:
branches: main
paths: ['**.cpp', '**.h', '**CMakeLists.txt']

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
# Start and join the Spigot Server
- name: Set up Minecraft testing environment
uses: nhatdongdang/mc-env-setup@v1

# Checkout the mcpp repository for building and testing
- name: Checkout mcpp
uses: actions/checkout@v4

# Build files using CMake
- name: Build file
run: cmake -Bbuild

# Run the test suite using ctest
- name: Run test suite
working-directory: ./build
run: make test_suite && ctest -R full -V
9 changes: 8 additions & 1 deletion .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
branches: main
paths: ['**.cpp', '**.h', '**CMakeLists.txt']

permissions:
contents: write
pull-requests: write
actions: write

jobs:
cpp-linter:
runs-on: ubuntu-latest
Expand All @@ -19,7 +24,9 @@ jobs:
with:
style: 'file' # Use .clang-format config file.
tidy-checks: '-*' # disable clang-tidy checks.
thread-comments: true
format-review: true

- name: Fast fail
- name: Run clang-format
if: steps.linter.outputs.clang-format-checks-failed > 0
run: exit 1
31 changes: 31 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: deploy-doxygen

on:
push:
branches:
- main
paths:
- "include/**"
- "Doxyfile"
- "**/*.md"

jobs:
build-and-deploy:
runs-on: ubuntu-latest

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

- name: Set up Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
- name: Generate Documentation
run: doxygen ./Doxyfile

- name: Deploying to Gh-pages
uses: jinxto/doxygen-env-setup@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Build artifacts
build
.cache
test/test_suite
test/local_tests

Expand Down Expand Up @@ -43,3 +45,6 @@ CMakeFiles
*.app
/cmake-build-debug-coverage/
/cmake-build-release-coverage/

#Generated documentation
doc/
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@ project(mcpp)

set(CMAKE_CXX_STANDARD 17)

set(PROJECT_SOURCE_DIR src)
set(MCPP_PUBLIC_INCLUDE_DIRECTORIES include/ )
set(MCPP_SRC_DIR src)
set(MCPP_INC_DIR include/mcpp)

# Testing
enable_testing()
add_subdirectory(test)
enable_testing()
add_test(NAME local COMMAND local_tests)
add_test(NAME full COMMAND test_suite)

# Source files
file(GLOB_RECURSE MCPP_INCLUDE_FILES "include/*.h")
file(GLOB_RECURSE MCPP_SOURCE_FILES "src/*.cpp")
file(GLOB_RECURSE MCPP_INCLUDE_FILES ${MCPP_INC_DIR}/*.h)
file(GLOB_RECURSE MCPP_SOURCE_FILES ${MCPP_SRC_DIR}/*.cpp)

# Library build
add_library(${PROJECT_NAME} STATIC ${MCPP_INCLUDE_FILES} ${MCPP_SOURCE_FILES})

target_include_directories(${PROJECT_NAME} PUBLIC ${MCPP_PUBLIC_INCLUDE_DIRECTORIES})
add_library(${PROJECT_NAME} SHARED ${MCPP_INCLUDE_FILES} ${MCPP_SOURCE_FILES})

set_target_properties(${PROJECT_NAME}
PROPERTIES
Expand Down
Loading

0 comments on commit 6392ab5

Please sign in to comment.