Skip to content

Update README.md

Update README.md #5

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
jobs:
lint:
name: SwiftLint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: SwiftLint
uses: norio-nomura/action-swiftlint@3.2.1
with:
args: --strict
test:
name: Test
runs-on: macos-latest
strategy:
matrix:
destination: ["platform=macOS"]
steps:
- uses: actions/checkout@v4
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_15.4.app/Contents/Developer
- name: Show Xcode version
run: xcodebuild -version
- name: Show available destinations
run: xcodebuild -project ModSwitchIME.xcodeproj -scheme ModSwitchIME -showdestinations
- name: Build
run: make build
- name: Run tests
run: make test
- name: Generate test coverage
run: make test-coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.xml
fail_ci_if_error: false
build:
name: Build
runs-on: macos-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_15.4.app/Contents/Developer
- name: Build for Release
run: make build-release
- name: Archive
run: make archive
env:
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ModSwitchIME-archive
path: build/ModSwitchIME.xcarchive
retention-days: 30
swift-package-manager:
name: Swift Package Manager
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build with SPM
run: make spm-build
- name: Test with SPM
run: make spm-test
security-scan:
name: Security Scan
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Run security scan
run: |
# Check for common security issues
grep -r "TODO.*security" . || true
grep -r "FIXME.*security" . || true
grep -r "password\|secret\|key" --include="*.swift" . || true
- name: Check for sensitive files
run: |
# Check for files that shouldn't be committed
find . -name "*.p12" -o -name "*.mobileprovision" -o -name "*.cer" | head -10
if [ -f "ExportOptions.plist" ]; then
grep -i "YOUR_TEAM_ID" ExportOptions.plist && echo "⚠️ Remember to update YOUR_TEAM_ID in ExportOptions.plist"
fi
validate-project:
name: Validate Project Structure
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Validate project structure
run: |
echo "Checking required files..."
test -f ModSwitchIME.xcodeproj/project.pbxproj || (echo "❌ Xcode project file missing" && exit 1)
test -f Package.swift || (echo "❌ Package.swift missing" && exit 1)
test -f Makefile || (echo "❌ Makefile missing" && exit 1)
test -f .swiftlint.yml || (echo "❌ SwiftLint config missing" && exit 1)
echo "Checking source files..."
test -f ModSwitchIME/App.swift || (echo "❌ App.swift missing" && exit 1)
test -f ModSwitchIME/MenuBarApp.swift || (echo "❌ MenuBarApp.swift missing" && exit 1)
test -f ModSwitchIME/Preferences.swift || (echo "❌ Preferences.swift missing" && exit 1)
test -f ModSwitchIME/ImeController.swift || (echo "❌ ImeController.swift missing" && exit 1)
test -f ModSwitchIME/KeyMonitor.swift || (echo "❌ KeyMonitor.swift missing" && exit 1)
echo "Checking test files..."
test -f ModSwitchIMETests/ImeControllerTests.swift || (echo "❌ ImeControllerTests.swift missing" && exit 1)
test -f ModSwitchIMETests/PreferencesLogicTests.swift || (echo "❌ PreferencesLogicTests.swift missing" && exit 1)
echo "✅ All required files found"
- name: Validate Makefile targets
run: |
echo "Validating Makefile targets..."
make help
echo "✅ Makefile is valid"