Skip to content

Commit

Permalink
Add build/spell-check/formatting workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeresman01 committed Feb 9, 2025
1 parent a6382bd commit cb6aae5
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
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
25 changes: 25 additions & 0 deletions .github/workflows/formatting.yml
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

Check warning on line 24 in .github/workflows/formatting.yml

View workflow job for this annotation

GitHub Actions / Check spelling

Unknown word (Werror)
done
14 changes: 14 additions & 0 deletions .github/workflows/spell-check.yml
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
27 changes: 27 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Static analysis

on:
push:
branches: main

jobs:
cppcheck:

Check warning on line 8 in .github/workflows/static-analysis.yml

View workflow job for this annotation

GitHub Actions / Check spelling

Unknown word (cppcheck)
name: Static analysis
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install cppcheck

Check warning on line 16 in .github/workflows/static-analysis.yml

View workflow job for this annotation

GitHub Actions / Check spelling

Unknown word (cppcheck)
run: sudo apt-get install -y cppcheck

Check warning on line 17 in .github/workflows/static-analysis.yml

View workflow job for this annotation

GitHub Actions / Check spelling

Unknown word (cppcheck)

- name: Run static analysis with cppcheck

Check warning on line 19 in .github/workflows/static-analysis.yml

View workflow job for this annotation

GitHub Actions / Check spelling

Unknown word (cppcheck)
run: |
cppcheck src/ --enable=all . \

Check warning on line 21 in .github/workflows/static-analysis.yml

View workflow job for this annotation

GitHub Actions / Check spelling

Unknown word (cppcheck)
--suppress=missingIncludeSystem 2> cppcheck-report.txt
if [ -s cppcheck-report.txt ]; then
echo "Reported issue: "
cat cppcheck-report.txt
exit 1
fi

0 comments on commit cb6aae5

Please sign in to comment.