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
63 changes: 8 additions & 55 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,22 @@

<!-- Mark the relevant option with an "x" -->

- [ ] πŸ› Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] πŸ’₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] πŸ“š Documentation update
- [ ] 🧹 Code cleanup/refactoring
- [ ] πŸ§ͺ Test improvements
- [ ] πŸ”§ Build/CI improvements

## Changes Made

<!-- Describe the changes you made. Be specific about what was changed and why -->

-
-
-

## Testing

<!-- Describe how you tested these changes -->

- [ ] I have tested these changes locally
- [ ] I have added/updated unit tests
- [ ] I have tested on multiple platforms (if applicable)
- [ ] I have tested with verbose mode enabled (if applicable)

### Platforms Tested

<!-- Mark all platforms you tested on -->

- [ ] iOS
- [ ] iPadOS
- [ ] macOS
- [ ] tvOS
- [ ] watchOS
- [ ] visionOS
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code cleanup/refactoring
- [ ] Test improvements
- [ ] Build/CI improvements

## Screenshots/Logs

<!-- If applicable, add screenshots or console output showing the changes -->

```
<!-- Paste any relevant console output or logs here -->
```

## Checklist

<!-- Mark completed items with an "x" -->

- [ ] My code follows the existing code style
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation (if applicable)
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have updated the CHANGELOG.md (if applicable)

## Related Issues

<!-- Link any related issues using "Closes #123" or "Fixes #123" -->

-

## Additional Notes

<!-- Add any additional notes, considerations, or context for reviewers -->
- [ ] I have updated the CHANGELOG.md (if applicable)
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:
- package-ecosystem: "swift"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "swift"
commit-message:
prefix: "chore"
include: "scope"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "github-actions"
- "dependencies"
commit-message:
prefix: "ci"
include: "scope"
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: CI

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

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
runs-on: macos-14

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

- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer

- name: Show Swift Version
run: swift --version

- name: Show Xcode Version
run: xcodebuild -version

- name: Cache Swift Package Manager
uses: actions/cache@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm/
~/.cache/org.swift.swiftpm/
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-

- name: Resolve Dependencies
run: swift package resolve

- name: Build
run: swift build --verbose

- name: Test
run: swift test --verbose --enable-code-coverage --parallel
env:
SWIFTUI_DEBUG_SCAN_VERBOSE: "1"

- name: Generate Code Coverage
run: |
# Find the actual test executable (SPM naming can vary)
TEST_EXECUTABLE=$(find .build/debug -name "*PackageTests.xctest" -type d | head -1)
if [ -z "$TEST_EXECUTABLE" ]; then
echo "No test executable found, skipping coverage"
exit 0
fi

EXECUTABLE_NAME=$(basename "$TEST_EXECUTABLE" .xctest)
EXECUTABLE_PATH="$TEST_EXECUTABLE/Contents/MacOS/$EXECUTABLE_NAME"

if [ ! -f "$EXECUTABLE_PATH" ]; then
echo "Test executable not found at $EXECUTABLE_PATH, skipping coverage"
exit 0
fi

xcrun llvm-cov export \
"$EXECUTABLE_PATH" \
-instr-profile .build/debug/codecov/default.profdata \
-format="lcov" > coverage.lcov

- name: Upload Code Coverage
if: hashFiles('coverage.lcov') != ''
uses: codecov/codecov-action@v4
with:
file: coverage.lcov
fail_ci_if_error: false
verbose: true

validate:
name: Package Validation
runs-on: macos-14

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

- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer

- name: Swift Package Validation
run: |
echo "=== Validating Package.swift syntax ==="
swift package dump-package > /dev/null

echo "=== Resolving dependencies ==="
swift package resolve

echo "=== Showing dependency tree ==="
swift package show-dependencies

echo "βœ… Package validation completed successfully"
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
name: Create Release
runs-on: macos-14

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

- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer

- name: Validate Package
run: |
swift package resolve
swift build --configuration release
swift test --configuration release

- name: Create Release Archive
run: |
# Create source archive
git archive --format=zip --prefix=swift-ui-debug-scan-${{ github.ref_name }}/ HEAD > swift-ui-debug-scan-${{ github.ref_name }}.zip

- name: Extract Release Notes
id: extract-release-notes
run: |
# Try to extract release notes from CHANGELOG.md if it exists
if [ -f CHANGELOG.md ]; then
# Extract content between the first two version headers
VERSION_LINE=$(grep -n "^## \[?${{ github.ref_name }}\]?" CHANGELOG.md | head -1 | cut -d: -f1)
if [ ! -z "$VERSION_LINE" ]; then
NEXT_VERSION_LINE=$(tail -n +$((VERSION_LINE + 1)) CHANGELOG.md | grep -n "^## " | head -1 | cut -d: -f1)
if [ ! -z "$NEXT_VERSION_LINE" ]; then
NEXT_VERSION_LINE=$((VERSION_LINE + NEXT_VERSION_LINE))
sed -n "${VERSION_LINE},${NEXT_VERSION_LINE}p" CHANGELOG.md | head -n -1 | tail -n +2 > release_notes.md
else
sed -n "${VERSION_LINE},$p" CHANGELOG.md | tail -n +2 > release_notes.md
fi
else
echo "Release ${{ github.ref_name }}" > release_notes.md
echo "See CHANGELOG.md for details." >> release_notes.md
fi
else
echo "Release ${{ github.ref_name }}" > release_notes.md
fi

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body_path: release_notes.md
files: |
swift-ui-debug-scan-${{ github.ref_name }}.zip
draft: false
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Security Workflow - CURRENTLY DISABLED
#
# This workflow is commented out because it requires Code Security/Code Scanning
# to be enabled in the repository settings.
#
# To enable this workflow:
# 1. Go to your repository Settings > Security & analysis
# 2. Enable "Code scanning"
# 3. Uncomment this entire file
# 4. The workflow provides automated security scanning with CodeQL
#
# For more information: https://docs.github.com/en/code-security/code-scanning

# name: Security

# on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
# schedule:
# # Run weekly security scans
# - cron: '0 2 * * 1'

# jobs:
# codeql:
# name: CodeQL Analysis
# runs-on: macos-14
# permissions:
# actions: read
# contents: read
# security-events: write
#
# strategy:
# fail-fast: false
# matrix:
# language: [ 'swift' ]
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v3
# with:
# languages: ${{ matrix.language }}
#
# - name: Select Xcode Version
# run: sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
#
# - name: Build for CodeQL
# run: |
# swift package resolve
# swift build --configuration release
#
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v3
# with:
# category: "/language:${{matrix.language}}"
Loading