This directory contains the GitHub Actions workflows for RuneKit's continuous integration and deployment pipeline.
The primary CI workflow that runs on every push and pull request:
Jobs:
-
build-and-test: Matrix build across macOS and Linux
- Builds debug and release configurations
- Runs comprehensive test suite with coverage
- Generates and uploads coverage reports to Codecov
- Caches Swift Package Manager dependencies
-
code-quality: Code style and quality checks
- SwiftFormat linting for consistent formatting
- SwiftLint analysis for code quality and conventions
- Runs on macOS with latest tools
-
sanitizer-tests: Memory safety validation
- Address Sanitizer (detects memory leaks and corruption)
- Undefined Behavior Sanitizer (catches UB issues)
- Thread Sanitizer (detects race conditions)
- Matrix across all sanitizer types
-
release-build: Production build verification
- Builds optimized release configuration
- Tests CLI executable functionality
-
all-checks: Aggregation job
- Ensures all previous jobs pass
- Required for branch protection
Enhanced validation for pull requests:
Jobs:
- quick-check: Fast validation for draft PRs
- comprehensive-checks: Reuses main CI pipeline
- pr-analysis: Analyzes PR size and complexity
- security-scan: Semgrep security analysis
- docs-check: Documentation coverage validation
- pr-ready: Final aggregation for merge readiness
Performance monitoring and regression detection:
Jobs:
- benchmark: Runs performance tests on main branch
- performance-comparison: Compares PR performance vs base
- Enforces consistent code formatting
- 120 character line limit
- 4-space indentation
- Modern Swift conventions
- Code quality and style enforcement
- Custom rules for ANSI sequences
- Documentation requirements for public APIs
- Performance and maintainability guidelines
- Comprehensive coverage of CI-generated files
- Coverage reports (*.lcov, *.profdata)
- Performance benchmark artifacts
- Temporary test files and logs
- Code quality tool caches
# Install code quality tools
brew install swiftformat swiftlint
# Optional: Install Semgrep for security scanning
pip install semgrep
# Set up development environment and format code
./scripts/format-code.sh
# Run the full CI validation suite
./scripts/ci-test.sh
# Manual formatting and linting (if tools installed)
swiftformat .
swiftlint lint --strict
Coverage is automatically collected during test runs and uploaded to Codecov. Local coverage reports can be generated using:
swift test --enable-code-coverage
# Coverage data will be in .build/debug/codecov/
The following checks are required for merging to main
:
- ✅ All CI jobs must pass
- ✅ Code quality checks must pass
- ✅ Security scan must pass
- ✅ Documentation checks must pass
- ✅ At least one approving review
The following secrets need to be configured in the repository:
CODECOV_TOKEN
: Token for uploading coverage reportsSEMGREP_APP_TOKEN
: Token for Semgrep security scanning (optional)
The CI pipeline enforces these performance benchmarks:
- Tokenize 1MB of ANSI text: <10ms
- Calculate width of 10k strings: <5ms
- Render 100-component tree: <16ms (60fps)
- Frame diff 1000 lines: <1ms
-
SwiftFormat/SwiftLint not found
- Install tools locally:
brew install swiftformat swiftlint
- Or run
./scripts/format-code.sh
for basic fixes
- Install tools locally:
-
Coverage generation fails
- Ensure tests are run with
--enable-code-coverage
- Check that test binaries are built correctly
- Ensure tests are run with
-
Sanitizer tests fail
- Review memory usage patterns
- Check for potential race conditions
- Ensure proper cleanup in tests
-
Performance regression
- Profile the specific failing benchmark
- Compare with baseline performance
- Optimize critical paths
- Check the Actions tab for detailed logs
- Review the specific job that failed
- Look for error messages in the CI output
- Ensure all required secrets are configured
When contributing to RuneKit:
- Run
./scripts/ci-test.sh
before pushing - Ensure all tests pass locally
- Follow the code style guidelines
- Add tests for new functionality
- Update documentation as needed
The CI pipeline will automatically validate your changes and provide feedback on any issues.