Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure CI/CD Pipelines and add pre-commit hooks #476

Merged
merged 7 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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