Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions .github/workflows/agent_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,12 @@ on:
push:
branches: [ "main", "devel" ]
paths:
- 'source/agent/**'
- 'libs/**'
- 'CMakeLists.txt'
- 'vcpkg.json'
- 'CMakePresets.json'
- 'sources/agent/'
- '.github/workflows/agent_ci.yml'
pull_request:
branches: [ "main", "devel" ]
paths:
- 'source/agent/**'
- 'libs/**'
- 'CMakeLists.txt'
- 'vcpkg.json'
- 'CMakePresets.json'
- 'sources/agent/'
- '.github/workflows/agent_ci.yml'

jobs:
Expand All @@ -31,26 +23,36 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup C++ tools
uses: aminya/setup-cpp@v1
with:
clang-format: true
cppcheck: true

- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake clang-format cppcheck
- name: Cache vcpkg
uses: actions/cache@v4
with:
path: |
~/.cache/vcpkg
sources/agent/build/vcpkg_installed
key: vcpkg-${{ runner.os }}-${{ hashFiles('sources/agent/vcpkg.json') }}

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'vcpkg.json'
vcpkgJsonGlob: 'sources/agent/vcpkg.json'

- name: Check Code Formatting
run: |
find source/agent -name "*.cc" -o -name "*.h" | xargs clang-format --dry-run --Werror -style=Google
find sources/agent/src -name "*.cc" -o -name "*.h" | xargs clang-format --dry-run --Werror -style=Google

- name: CMake Configure
run: cmake --preset default
working-directory: sources/agent
run: cmake --preset default -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build --preset default
working-directory: sources/agent
run: cmake --build --preset default -j$(nproc)

- name: Analyze Logic
run: |
Expand All @@ -59,5 +61,5 @@ jobs:
--suppress=missingIncludeSystem \
--inline-suppr \
--force \
-i build \
source/agent
-i sources/agent/build \
sources/agent
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# --- Shared ---
.vscode/
*.code-workspace

# --- Agent ---
build/
out/
bin/

.cache/
compile_commands.json
sources/agent/agent.conf
.clang-format

# --- Server ---
sources/server/generated/
79 changes: 0 additions & 79 deletions CMakeLists.txt

This file was deleted.

23 changes: 23 additions & 0 deletions scripts/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

REPO_ROOT=$(git rev-parse --show-toplevel)
BUILD_DIR="$REPO_ROOT/sources/agent/build"

if [ ! -d "$BUILD_DIR" ]; then
echo "Build directory not found: $BUILD_DIR"
echo "Run cmake --preset debug in sources/agent first."
exit 1
fi

# Sprawdź tylko pliki staged do commita
STAGED=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(cc|h)$')

if [ -z "$STAGED" ]; then
exit 0
fi

cmake --build "$BUILD_DIR" --target check-format
if [ $? -ne 0 ]; then
echo "Formatting errors found. Run 'cmake --build $BUILD_DIR --target format' to fix."
exit 1
fi
59 changes: 0 additions & 59 deletions source/agent/CMakeLists.txt

This file was deleted.

Loading
Loading