Skip to content

Commit 81a7430

Browse files
authored
Merge pull request #20 from jideoyelayo1/jlasses-workflow-additions-1
2 parents 5204476 + 530cd8c commit 81a7430

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Code Formatting
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Install clang-format
17+
run: sudo apt-get install -y clang-format
18+
19+
- name: Run clang-format and check for formatting issues
20+
run: |
21+
find . -name "*.cpp" -o -name "*.hpp" | xargs clang-format -i
22+
23+
- name: Commit formatting changes
24+
run: |
25+
git config --global user.name "github-actions"
26+
git config --global user.email "github-actions@github.com"
27+
git add .
28+
git commit -m "Apply code formatting changes" || echo "No changes to commit"
29+
continue-on-error: true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Static Code Analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
static-analysis:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Install Cppcheck
17+
run: sudo apt-get install -y cppcheck
18+
19+
- name: Run Cppcheck
20+
run: |
21+
cppcheck --enable=all --inconclusive --quiet --suppress=missingIncludeSystem . 2> cppcheck-results.txt
22+
cat cppcheck-results.txt
23+
continue-on-error: true

0 commit comments

Comments
 (0)