Skip to content
Closed
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
31 changes: 31 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 120
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignOperands: Align
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
BreakBeforeBraces: Attach
BreakConstructorInitializers: BeforeColon
IncludeBlocks: Regroup
IndentCaseLabels: true
PointerAlignment: Left
ReferenceAlignment: Left
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
FixNamespaceComments: true
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
142 changes: 140 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@ name: CI

on:
push:
branches: [main]
branches:
- main
- develop
- 'release/**'
- 'hotfix/**'
- 'rc*'
tags:
- 'v*'
pull_request:
branches: [main]
branches:
- main
- develop
- 'release/**'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -104,3 +114,131 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: build/coverage.xml
format: cobertura

static-analysis:
runs-on: ubuntu-latest

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

- name: Setup environment
id: setup-env
uses: ./.github/actions/setup-env
with:
gcc_version: 12
python_version: "3.12"
conan_cache: 'true'

- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy-16

- name: Install Conan dependencies
run: |
conan install . \
--options="python=True" \
--lockfile=conan.lock \
--lockfile-partial \
--lockfile-out=conan.lock \
--build=missing \
--profile ${{ steps.setup-env.outputs.conan-profile-name }} \
-s build_type=Debug

- name: Configure CMake
run: cmake --preset conan-debug

- name: Run clang-tidy
run: |
find src include -name "*.cpp" -o -name "*.hpp" | \
xargs clang-tidy-16 \
-p=build/Debug \
--config-file=.clang-tidy \
--format-style=file \
|| exit 0 # Don't fail on clang-tidy warnings for now

documentation:
runs-on: ubuntu-latest

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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install documentation dependencies
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
python -m pip install --upgrade pip
python -m pip install sphinx sphinx-rtd-theme breathe sphinx-rtd-dark-mode

- name: Build documentation
run: |
cd docs
make html

- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: build/docs/sphinx/
retention-days: 7

package-validation:
runs-on: ubuntu-latest

strategy:
matrix:
build_type: [Release, Debug]

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

- name: Setup environment
id: setup-env
uses: ./.github/actions/setup-env
with:
gcc_version: 12
python_version: "3.12"
conan_cache: 'true'

- name: Create Conan package
run: |
conan create . \
--build=missing \
--profile ${{ steps.setup-env.outputs.conan-profile-name }} \
-s build_type=${{ matrix.build_type }}

- name: Test package consumption
run: |
cd test_package
conan test . emu/1.0.0@ \
--profile ${{ steps.setup-env.outputs.conan-profile-name }} \
-s build_type=${{ matrix.build_type }}

security-scan:
runs-on: ubuntu-latest

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

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'
88 changes: 88 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Code Quality

on:
pull_request:
branches:
- main
- develop
- 'release/**'
workflow_dispatch:

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

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

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-16

- name: Check code formatting
run: |
find src include -name "*.cpp" -o -name "*.hpp" -o -name "*.cu" -o -name "*.cuh" | \
xargs clang-format-16 --dry-run --Werror --style=file

lint-check:
runs-on: ubuntu-latest

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

- name: Setup environment
id: setup-env
uses: ./.github/actions/setup-env
with:
gcc_version: 12
python_version: "3.12"
conan_cache: 'true'

- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy-16

- name: Install Conan dependencies
run: |
conan install . \
--lockfile=conan.lock \
--lockfile-partial \
--lockfile-out=conan.lock \
--build=missing \
--profile ${{ steps.setup-env.outputs.conan-profile-name }} \
-s build_type=Debug

- name: Configure CMake
run: cmake --preset conan-debug

- name: Run clang-tidy
run: |
find src include -name "*.cpp" -o -name "*.hpp" | \
xargs clang-tidy-16 \
-p=build/Debug \
--config-file=.clang-tidy \
--format-style=file \
--warnings-as-errors='*' \
|| echo "Clang-tidy found issues"

- name: Generate clang-tidy report
if: always()
run: |
find src include -name "*.cpp" -o -name "*.hpp" | \
xargs clang-tidy-16 \
-p=build/Debug \
--config-file=.clang-tidy \
--format-style=file \
> clang-tidy-report.txt 2>&1 || true

- name: Upload clang-tidy report
uses: actions/upload-artifact@v4
if: always()
with:
name: clang-tidy-report
path: clang-tidy-report.txt
retention-days: 7
115 changes: 115 additions & 0 deletions .github/workflows/dependency-management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Dependency Management

on:
schedule:
# Run weekly on Mondays at 9 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch:

jobs:
dependency-scan:
runs-on: ubuntu-latest

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

- name: Setup environment
id: setup-env
uses: ./.github/actions/setup-env
with:
gcc_version: 12
python_version: "3.12"
conan_cache: 'true'

- name: Install dependencies
run: |
conan install . \
--lockfile=conan.lock \
--lockfile-partial \
--lockfile-out=conan.lock \
--build=missing \
--profile ${{ steps.setup-env.outputs.conan-profile-name }}

- name: Check for dependency updates
run: |
echo "Checking for Conan dependency updates..."
conan search fmt/* --remote=conancenter | head -10
conan search boost/* --remote=conancenter | head -10
conan search gtest/* --remote=conancenter | head -10

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'table'

- name: Generate dependency report
run: |
echo "# Dependency Report" > dependency-report.md
echo "" >> dependency-report.md
echo "Generated on: $(date)" >> dependency-report.md
echo "" >> dependency-report.md
echo "## Current Dependencies" >> dependency-report.md
echo "" >> dependency-report.md
echo "\`\`\`" >> dependency-report.md
conan info . >> dependency-report.md
echo "\`\`\`" >> dependency-report.md

- name: Upload dependency report
uses: actions/upload-artifact@v4
with:
name: dependency-report
path: dependency-report.md
retention-days: 30

performance-regression:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' # Only run on manual trigger for now

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

- name: Setup environment
id: setup-env
uses: ./.github/actions/setup-env
with:
gcc_version: 12
python_version: "3.12"
conan_cache: 'true'

- name: Install Conan dependencies
run: |
conan install . \
--build=missing \
--profile ${{ steps.setup-env.outputs.conan-profile-name }} \
-s build_type=Release

- name: Configure CMake
run: cmake --preset conan-release

- name: Build project
run: cmake --build --preset conan-release

- name: Run performance tests
run: |
# This would run performance benchmarks if they exist
echo "Performance tests would run here"
# ctest --preset conan-release -L "performance"

- name: Generate performance report
run: |
echo "# Performance Report" > performance-report.md
echo "" >> performance-report.md
echo "Generated on: $(date)" >> performance-report.md
echo "" >> performance-report.md
echo "Performance benchmarks would be reported here." >> performance-report.md

- name: Upload performance report
uses: actions/upload-artifact@v4
with:
name: performance-report
path: performance-report.md
retention-days: 30
Loading