Skip to content
Draft
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
73 changes: 73 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build Check

on:
push:
branches: [ main, develop, 'copilot/**' ]
pull_request:
branches: [ main, develop ]

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

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

- name: Cache devkitARM
uses: actions/cache@v3
id: cache-devkitarm
with:
path: /opt/devkitpro
key: ${{ runner.os }}-devkitarm-r64

- name: Install devkitARM
if: steps.cache-devkitarm.outputs.cache-hit != 'true'
run: |
wget https://github.com/devkitPro/pacman/releases/latest/download/devkitpro-pacman.amd64.deb
sudo dpkg -i devkitpro-pacman.amd64.deb
sudo dkp-pacman -Sy
sudo dkp-pacman -S --noconfirm devkitARM

- name: Set environment variables
run: |
echo "DEVKITPRO=/opt/devkitpro" >> $GITHUB_ENV
echo "DEVKITARM=/opt/devkitpro/devkitARM" >> $GITHUB_ENV
echo "/opt/devkitpro/devkitARM/bin" >> $GITHUB_PATH

- name: Build bootloader
run: |
make -j$(nproc)

- name: Build Nyx
run: |
cd nyx
make -j$(nproc)

- name: Check USB objects were built
run: |
echo "Checking USB host object files..."
test -f nyx/build/nyx/xhci.o || { echo "Error: xhci.o not built"; exit 1; }
test -f nyx/build/nyx/usb_msc_host.o || { echo "Error: usb_msc_host.o not built"; exit 1; }
test -f nyx/build/nyx/emummc_storage_usb.o || { echo "Error: emummc_storage_usb.o not built"; exit 1; }
echo "✅ All USB objects built successfully"

- name: Upload artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: hekate-binaries
path: |
output/*.bin
nyx/output/*.bin
retention-days: 7

- name: Check file sizes
run: |
echo "Bootloader binary sizes:"
ls -lh output/*.bin
echo ""
echo "Nyx binary sizes:"
ls -lh nyx/output/*.bin
73 changes: 73 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Static Analysis

on:
push:
branches: [ main, develop, 'copilot/**' ]
pull_request:
branches: [ main, develop ]

jobs:
cppcheck:
runs-on: ubuntu-latest

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

- name: Install cppcheck
run: sudo apt-get update && sudo apt-get install -y cppcheck

- name: Run cppcheck on USB files
run: |
cppcheck --enable=warning,style,performance,portability \
--error-exitcode=0 \
--inline-suppr \
-I bdk \
--suppress=missingIncludeSystem \
--suppress=unusedFunction \
bdk/usb/xhci.c \
bdk/usb/usb_msc_host.c \
nyx/nyx_gui/emummc_storage_usb.c \
2>&1 | tee cppcheck-results.txt

- name: Upload cppcheck results
if: always()
uses: actions/upload-artifact@v3
with:
name: cppcheck-results
path: cppcheck-results.txt

documentation-check:
runs-on: ubuntu-latest

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

- name: Check documentation exists
run: |
test -f README_USB_STORAGE.md || { echo "Missing README_USB_STORAGE.md"; exit 1; }
test -f IMPLEMENTATION_STATUS.md || { echo "Missing IMPLEMENTATION_STATUS.md"; exit 1; }
test -f DEVELOPMENT_SUMMARY.md || { echo "Missing DEVELOPMENT_SUMMARY.md"; exit 1; }
test -f CODE_REVIEW_SUGGESTIONS.md || { echo "Missing CODE_REVIEW_SUGGESTIONS.md"; exit 1; }
test -f TESTING_FRAMEWORK.md || { echo "Missing TESTING_FRAMEWORK.md"; exit 1; }
echo "✅ All documentation files present"

- name: Check for TODO markers
run: |
echo "Checking for TODO/FIXME markers in code..."
echo "Found in USB files:"
grep -rn "TODO\|FIXME\|XXX" bdk/usb/ nyx/nyx_gui/emummc_storage_usb.c || echo "None"

- name: Verify header guards
run: |
echo "Checking header guards..."
for f in bdk/usb/*.h nyx/nyx_gui/emummc_storage_usb.h; do
if [ -f "$f" ]; then
echo "Checking $f"
grep -q "#ifndef.*_H" "$f" || { echo "Missing header guard in $f"; exit 1; }
grep -q "#define.*_H" "$f" || { echo "Missing header guard in $f"; exit 1; }
grep -q "#endif" "$f" || { echo "Missing #endif in $f"; exit 1; }
fi
done
echo "✅ All header guards present"
Loading