-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4df429
commit f8ac62a
Showing
3 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |