-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build/spell-check/formatting workflows
- Loading branch information
1 parent
a6382bd
commit cb6aae5
Showing
4 changed files
with
93 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up GCC | ||
run: sudo apt-get install -y gcc g++ | ||
|
||
- name: Install CMake | ||
run: sudo apt-get install -y cmake | ||
|
||
- name: Configure CMake | ||
run: mkdir -p build && cd build && cmake .. | ||
|
||
- name: Build the project | ||
run: cd build && make |
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,25 @@ | ||
name: Formatting check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install clang-format | ||
run: sudo apt-get install clang-format -y | ||
|
||
- name: Check formatting | ||
run: | | ||
files=$(find . -name '*.cpp' -o -name '*.h') | ||
for file in $files; do | ||
clang-format -n -Werror $file | ||
done |
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,14 @@ | ||
name: 'Check spelling' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
spellcheck: | ||
name: Check spelling | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: streetsidesoftware/cspell-action@v2 |
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,27 @@ | ||
name: Static analysis | ||
|
||
on: | ||
push: | ||
branches: main | ||
|
||
jobs: | ||
cppcheck: | ||
name: Static analysis | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install cppcheck | ||
run: sudo apt-get install -y cppcheck | ||
|
||
- name: Run static analysis with cppcheck | ||
run: | | ||
cppcheck src/ --enable=all . \ | ||
--suppress=missingIncludeSystem 2> cppcheck-report.txt | ||
if [ -s cppcheck-report.txt ]; then | ||
echo "Reported issue: " | ||
cat cppcheck-report.txt | ||
exit 1 | ||
fi |