Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthospap committed Dec 15, 2024
1 parent e4df429 commit f8ac62a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 18 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Linux CI build

on:
push:
branches: [ "master", "cleanup" ]
branches: [ "master" ]
pull_request:
branches: [ "master" ]

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/minimal-linux-build.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f8ac62a

Please sign in to comment.