diff --git a/.github/workflows/build-and-lint.yml b/.github/workflows/build-and-lint.yml index 3bb3a8a..fed17b5 100644 --- a/.github/workflows/build-and-lint.yml +++ b/.github/workflows/build-and-lint.yml @@ -10,13 +10,3 @@ jobs: - name: Check format run: | find . -path ./build -prune -o -type f -name '*.[c|h]' -print | xargs clang-format-18 --style=file --dry-run -Werror - - name: Configure - run: | - # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON is important for clang-tidy - cmake . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - name: Build - run: | - cmake --build build - - name: Lint - run: | - run-clang-tidy-18 -p=build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b068e4..d00ba3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.25) project(C_Homework C) add_subdirectory(src/CheckHowLintersWork) +add_subdirectory(src/HelloWorldDir) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/src/HelloWorldDir/CMakeLists.txt b/src/HelloWorldDir/CMakeLists.txt new file mode 100644 index 0000000..d2991c1 --- /dev/null +++ b/src/HelloWorldDir/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(helloWorld helloWorld.c) \ No newline at end of file diff --git a/src/HelloWorldDir/helloWorld.c b/src/HelloWorldDir/helloWorld.c new file mode 100644 index 0000000..d1f4af6 --- /dev/null +++ b/src/HelloWorldDir/helloWorld.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + printf("Hello, world!\n"); + return 0; +} \ No newline at end of file