Skip to content

Commit

Permalink
Merge pull request #476 from vortexntnu/470-task-set-up-cicd-pipeline…
Browse files Browse the repository at this point in the history
…s-for-c

Restructure CI/CD Pipelines and add pre-commit hooks
  • Loading branch information
kluge7 authored Oct 1, 2024
2 parents 9005aed + 32a0f1c commit fe4077a
Show file tree
Hide file tree
Showing 46 changed files with 1,469 additions and 1,504 deletions.
137 changes: 0 additions & 137 deletions .clang-format

This file was deleted.

2 changes: 1 addition & 1 deletion .codespellignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theses
theses
23 changes: 23 additions & 0 deletions .github/workflows/bandit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Bandit Security Scan

on: [pull_request]

jobs:
bandit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install bandit
run: |
python -m pip install bandit[toml]
- name: Run bandit scan
run: |
bandit -c pyproject.toml -r . --severity-level medium
23 changes: 23 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Black Code Formatter Check

on: [pull_request]

jobs:
black:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install black
run: |
python -m pip install black
- name: Run black
run: |
black --check .
33 changes: 33 additions & 0 deletions .github/workflows/clang-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Clang-Format Code Style Check

on: [pull_request]

jobs:
clang-format:
runs-on: ubuntu-latest

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

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Run clang-format check
run: |
# Find all C/C++ source and header files
find . -type f \( -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.h' -o -name '*.hpp' -o -name '*.hh' -o -name '*.hxx' \) -print0 | xargs -0 clang-format -i
# Check if any files were modified
if [[ $(git status --porcelain) ]]; then
echo "Code is not properly formatted. Please run clang-format."
echo "Modified files:"
git status --porcelain
echo "Differences:"
git --no-pager diff
exit 1
else
echo "All code is properly formatted."
fi
23 changes: 23 additions & 0 deletions .github/workflows/isort.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: isort Import Sorting Check

on: [pull_request]

jobs:
isort:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install isort
run: |
python -m pip install isort
- name: Run isort
run: |
isort --check .
23 changes: 23 additions & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Mypy Type Checker

on: [pull_request]

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install mypy
run: |
python -m pip install mypy
- name: Run mypy
run: |
mypy . --explicit-package-bases
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint Code Linter

on: [pull_request]

jobs:
pylint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install pylint
run: |
python -m pip install pylint
- name: Run pylint
run: |
pylint .
99 changes: 0 additions & 99 deletions .github/workflows/python-checks.yaml

This file was deleted.

Loading

0 comments on commit fe4077a

Please sign in to comment.