This directory contains automated workflows for continuous integration and testing of the Swift DICOM Decoder library.
Comprehensive test suite that runs on every push and pull request to main and develop branches.
Features:
-
macOS Testing
- Tests on multiple Xcode versions (15.2, 15.4) for compatibility
- Runs
swift testwith code coverage enabled - Generates and uploads coverage reports to Codecov
-
iOS Simulator Testing
- Tests on multiple iOS versions (17.2, 17.4)
- Tests on different iPhone simulators (iPhone 15, iPhone 15 Pro)
- Uses
xcodebuildfor iOS-specific testing - Generates iOS-specific coverage reports
-
Code Quality Checks
- Verifies no debug
print()statements in production code - Optional SwiftFormat linting (if
.swiftformatconfig exists) - Scans for TODO/FIXME comments for awareness
- Verifies no debug
-
Test Summary
- Aggregates results from all test jobs
- Posts summary to GitHub Actions UI
- Fails if any test job fails
Coverage Reporting:
- Coverage data is generated using Swift's built-in code coverage (
--enable-code-coverage) - Reports are converted to lcov format for macOS tests
- Reports are uploaded to Codecov (requires
CODECOV_TOKENsecret) - Coverage is tracked separately for macOS and iOS platforms
Setup Requirements:
-
Codecov Integration (Optional but Recommended)
- Sign up at https://codecov.io
- Add repository to Codecov
- Add
CODECOV_TOKENto GitHub repository secrets - If not using Codecov, coverage upload steps will be skipped gracefully
-
Branch Protection (Recommended)
- Enable "Require status checks to pass before merging"
- Select "Test on macOS" and "Test on iOS Simulator" as required checks
- This ensures all tests pass before code can be merged
Local Testing:
To run the same tests locally:
# macOS tests with coverage
swift test --enable-code-coverage
# View coverage report
xcrun llvm-cov report \
.build/debug/DicomCorePackageTests.xctest/Contents/MacOS/DicomCorePackageTests \
-instr-profile .build/debug/codecov/default.profdata
# iOS simulator tests
xcodebuild test \
-scheme DicomCore-Package \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro' \
-enableCodeCoverage YESExtending the Workflow:
To add new checks or modify test behavior:
- Edit
.github/workflows/tests.yml - Test locally using act (GitHub Actions local runner)
- Push changes and verify in Actions tab
- Monitor for any failures and iterate
Performance:
- Full test suite runs in ~5-10 minutes depending on runner availability
- Matrix strategy runs jobs in parallel for faster feedback
- Failed tests provide detailed logs for debugging
Maintenance:
- Update Xcode versions as new releases become available
- Update iOS simulator versions to match supported platforms in Package.swift
- Review and update runner versions (
macos-14) periodically - Monitor for deprecated GitHub Actions features