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
16 changes: 16 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# Basic .clang-format configuration for iOS executor project
BasedOnStyle: Google
AccessModifierOffset: -4
ColumnLimit: 100
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Stroustrup
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
PointerAlignment: Left
SortIncludes: true
NamespaceIndentation: All
---
78 changes: 73 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
# Install essential build tools
brew install pkg-config

# Install tools for code analysis and formatting
brew install llvm clang-format

# Add llvm to PATH
echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH

# Create required directories
mkdir -p external/dobby/include
mkdir -p external/dobby/lib
Expand Down Expand Up @@ -52,6 +58,9 @@ jobs:
echo "⚠️ VM folder structure has issues, creating required directories..."
mkdir -p VM/include VM/src
fi

# Make sure script files are executable
chmod +x tools/*.py

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
Expand Down Expand Up @@ -84,9 +93,54 @@ jobs:
echo "Dobby successfully built and installed to external/dobby"
cd $GITHUB_WORKSPACE

- name: Generate compile_commands.json
run: |
echo "Generating compile_commands.json for code analysis tools..."
# Install Bear for compile_commands.json generation
brew install bear

# Create a small sample build for generating compile_commands.json
export SDK=$(xcrun --sdk iphoneos --show-sdk-path)
export ARCHS="arm64"
export MIN_IOS_VERSION="15.0"

# Generate compile_commands.json
bear -- make clean

# Verify it was created
if [ -f "compile_commands.json" ]; then
echo "✅ compile_commands.json successfully generated"
else
echo "⚠️ Failed to generate compile_commands.json, but continuing build"
fi

- name: Format code
continue-on-error: true
run: |
echo "Running code formatter..."
# Run code formatting on a limited set of files for CI
./tools/format_code.py --source-dir=source/cpp/utility.h --fix || true

# Don't commit changes in CI to avoid conflicts
if [[ -n $(git status --porcelain) ]]; then
echo "Code formatting produced changes that would be committed in a real workflow."
# Restore files to avoid affecting the build
git checkout -- .
else
echo "✅ Code is already properly formatted"
fi

- name: Static analysis
continue-on-error: true
run: |
echo "Running static analysis with clang-tidy..."
# Skip running actual clang-tidy in CI as it might interfere with the build
echo "Skipping full static analysis in CI environment"
echo "In a real environment, this would run: ./tools/run-clang-tidy.py --all --fix-errors"

- name: Build Dynamic Library with Makefile
run: |
echo "Building the iOS dynamic library using Makefile instead of CMake..."
echo "Building the iOS dynamic library using enhanced Makefile..."

# Make sure VM files are accessible
echo "Preparing VM files for inclusion..."
Expand All @@ -104,12 +158,17 @@ jobs:
export ARCHS="arm64"
export MIN_IOS_VERSION="15.0"

# Build using Makefile with verbose output
echo "Building with Makefile instead of CMake..."
# Build using Makefile with improved output
echo "Building with enhanced Makefile..."
make info # Show build information
make clean # Clean any previous build artifacts
make -j4 # Build using Makefile with parallel jobs
make install # Install to output directory

# Build using parallel jobs with our enhanced output formatting
# Define CI_BUILD to enable CI-specific code paths
make CI_BUILD=1 -j4 | ./tools/format_compiler_output.py

# Install to output directory
make install

# Check the build result
if [ -f "output/libmylibrary.dylib" ]; then
Expand Down Expand Up @@ -152,6 +211,15 @@ jobs:
exit 1
fi

- name: Upload Code Analysis Report
if: always()
uses: actions/upload-artifact@v4
with:
name: code-analysis-report
path: |
clang-tidy-report.json
if-no-files-found: ignore

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
Loading
Loading