Skip to content
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
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: iOS CI

on:
pull_request:
push:
branches: [main, develop]

env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer

jobs:
ci:
name: Build, Test & Quality Checks
runs-on: macos-latest

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

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "16.4"

- name: Auto-configure if unconfigured
run: |
# Detect if this is an unconfigured template
if grep -q "{{PROJECT_NAME}}" project.yml 2>/dev/null; then
echo "🔧 Unconfigured template detected - generating minimal test project"
./scripts/setup.sh \
--project-name "CITestApp" \
--bundle-id-root "com.ci.test" \
--deployment-target 18.0 \
--swift-version 6.2 \
--test-framework "swift-testing" \
--structure mvvm \
--generate-minimal \
--no-git-hooks \
--no-commit \
--skip-brew \
--force
echo "✅ Template auto-configured for CI testing"
else
echo "✅ Project already configured (derived repository)"
fi

- name: Cache Homebrew packages
uses: actions/cache@v4
with:
path: |
~/Library/Caches/Homebrew
/usr/local/Homebrew
key: ${{ runner.os }}-homebrew-${{ hashFiles('**/Brewfile') }}
restore-keys: |
${{ runner.os }}-homebrew-

- name: Install dependencies
run: |
echo "📦 Installing Homebrew dependencies..."
brew bundle install --file=./Brewfile

echo "✅ Installed versions:"
swiftlint --version
swiftformat --version
xcodegen --version
yq --version

- name: Generate Xcode project
run: |
echo "🏗️ Generating Xcode project from project.yml..."
xcodegen generate

PROJECT_NAME=$(yq eval '.name' project.yml)
if [ -d "${PROJECT_NAME}.xcodeproj" ]; then
echo "✅ Xcode project generated: ${PROJECT_NAME}.xcodeproj"
else
echo "❌ Failed to generate Xcode project"
exit 1
fi

- name: Run preflight checks
run: |
echo "🚀 Running preflight checks (format, lint, build, test)..."
./scripts/preflight.sh

- name: CI Summary
if: success()
run: |
echo ""
echo "🎉 CI Complete!"
echo ""
echo "✅ Code formatting validated"
echo "✅ Code quality checks passed"
echo "✅ Build completed successfully"
echo "✅ Tests executed"
echo ""
echo "Ready for review! 🚀"
145 changes: 0 additions & 145 deletions .github/workflows/template-validation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion templates/.swiftformat.template → .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
--exclude .build
--exclude DerivedData
--exclude build
--exclude **/.git
--exclude **/.git
2 changes: 1 addition & 1 deletion templates/.swiftlint.yml.template → .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ custom_rules:
message: "Prefer @objc on individual members over @objcMembers"
severity: warning

reporter: "xcode"
reporter: "xcode"
Loading
Loading