diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 5050682..aa8c9f5 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -1,24 +1,27 @@ -name: clang-format Check +name: Clang-Format Check + on: push: - branches: [ "master", "cleanup" ] + branches: + - main pull_request: - branches: [ "master" ] jobs: - formatting-check: - name: Formatting Check + check-format: runs-on: ubuntu-latest - strategy: - matrix: - path: - - 'src' - - 'test' steps: - - uses: actions/checkout@v3 - - name: Run clang-format style check for C/C++/Protobuf programs. - uses: jidicula/clang-format-action@v4.11.0 - with: - clang-format-version: '16' - check-path: ${{ matrix.path }} - fallback-style: 'LLVM' # optional + # Step 1: Checkout the code + - uses: actions/checkout@v3 + + # Step 2: Install clang-format + - name: Install clang-format + run: sudo apt-get update && sudo apt-get install -y clang-format + + # Step 3: Check formatting + - name: Run clang-format + run: | + # Find all .cpp and .hpp files + find . -name '*.cpp' -o -name '*.hpp' > files_to_check.txt + + # Check if clang-format would make changes + clang-format --dry-run -Werror $(cat files_to_check.txt) diff --git a/.github/workflows/cpp-linux-build.yml b/.github/workflows/full-linux-build.yml similarity index 98% rename from .github/workflows/cpp-linux-build.yml rename to .github/workflows/full-linux-build.yml index ef8aaff..c75d309 100644 --- a/.github/workflows/cpp-linux-build.yml +++ b/.github/workflows/full-linux-build.yml @@ -2,7 +2,7 @@ name: Linux CI build on: push: - branches: [ "master", "cleanup" ] + branches: [ "master" ] pull_request: branches: [ "master" ] diff --git a/.github/workflows/minimal-linux-build.yml b/.github/workflows/minimal-linux-build.yml new file mode 100644 index 0000000..bb1954f --- /dev/null +++ b/.github/workflows/minimal-linux-build.yml @@ -0,0 +1,37 @@ +name: Linux CI build + +on: + push: + branches: [ "master", "cleanup" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Clang + uses: egor-tensin/setup-clang@v1 + with: + version: latest + + - name: "prepare build (production/standard), gcc, c++17" + run: cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ + - name: "build" + run: cmake --build build --target all --config Release -- -j4 + - name: "Test" + run: ctest --test-dir build + + - name: "production/standard, clang, c++17" + run: cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ + - name: "build" + run: cmake --build build --target all --config Release -- -j4 + + - name: "production/standard, gcc 20" + run: cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_COMPILER=g++ + - name: "build" + run: cmake --build build --target all --config Release -- -j4