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
135 changes: 84 additions & 51 deletions .github/workflows/VerifyChanges.yaml
Original file line number Diff line number Diff line change
@@ -1,128 +1,161 @@
name: Verify Changes

on:
merge_group:
pull_request:
branches: "**"
push:
branches: ["main"]

env:
XCODE_VERSION: 26.0.1

jobs:
lint:
name: Lint
runs-on: macos-15
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select Xcode 16.4
run: |
sudo xcode-select -s /Applications/Xcode_16.4.0.app
- name: Select Xcode ${{ env.XCODE_VERSION }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: Lint
run: |
Scripts/lint

build-and-test:
name: Build and Test (${{ matrix.platform }})
needs: lint
runs-on: macos-15
runs-on: macos-26
strategy:
fail-fast: false
matrix:
include:
- platform: iOS
xcode_destination: "platform=iOS Simulator,name=iPhone 16 Pro"
# - platform: iOS
# xcode_destination: "platform=iOS Simulator,name=GitHub_Actions_Simulator"
# simulator_device_type: "com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro"
# simulator_runtime: "com.apple.CoreSimulator.SimRuntime.iOS-26-0"
- platform: macOS
xcode_destination: "platform=macOS,arch=arm64"
- platform: tvOS
xcode_destination: "platform=tvOS Simulator,name=Apple TV 4K (3rd generation)"
- platform: watchOS
xcode_destination: "platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)"
# simulator_device_type: ""
# simulator_runtime: ""
# - platform: tvOS
# xcode_destination: "platform=tvOS Simulator,name=GitHub_Actions_Simulator"
# simulator_device_type: "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-4K"
# simulator_runtime: "com.apple.CoreSimulator.SimRuntime.tvOS-26-0"
# - platform: watchOS
# xcode_destination: "platform=watchOS Simulator,name=GitHub_Actions_Simulator"
# simulator_device_type: "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-10-46mm"
# simulator_runtime: "com.apple.CoreSimulator.SimRuntime.watchOS-26-0"

env:
DEV_BUILDS: DevBuilds/Sources
OTHER_XCBEAUTIFY_FLAGS: --renderer github-actions
XCCOV_PRETTY_VERSION: 1.2.0
XCODE_SCHEME: DevConfiguration
XCODE_DESTINATION: ${{ matrix.xcode_destination }}
XCODE_TEST_PLAN: DevConfiguration
XCODE_TEST_PLAN: AllTests
XCODE_TEST_PRODUCTS_PATH: .build/DevConfiguration.xctestproducts

steps:
- name: Select Xcode ${{ env.XCODE_VERSION }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app

- name: Checkout
uses: actions/checkout@v4

- name: Checkout DevBuilds
uses: actions/checkout@v4
with:
repository: DevKitOrganization/DevBuilds
path: DevBuilds
- name: Download xccovPretty

- name: Restore XCTestProducts
if: github.event_name != 'push'
run: |
gh release download ${{ env.XCCOV_PRETTY_VERSION }} \
--repo DevKitOrganization/xccovPretty \
--pattern "xccovPretty-macos.tar.gz" \
-O - | tar -xz
chmod +x xccovPretty
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: cache-xctestproducts-restore
uses: actions/cache/restore@v4
with:
path: ${{ env.XCODE_TEST_PRODUCTS_PATH }}
key: cache-xctestproducts-${{ github.workflow }}-${{ matrix.platform }}-${{ env.XCODE_VERSION }}-${{ github.sha }}

- uses: irgaly/xcode-cache@v1
if: steps.cache-xctestproducts-restore.outputs.cache-hit != 'true'
with:
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.platform }}-${{ github.sha }}
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.platform }}-${{ env.XCODE_VERSION }}-${{ github.sha }}
restore-keys: |
xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.platform }}-
xcode-cache-deriveddata-
deriveddata-directory: .build/DerivedData
sourcepackages-directory: .build/DerivedData/SourcePackages
swiftpm-package-resolved-file: |
**/*.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Package.resolved
swiftpm-package-resolved-file: Package.resolved
verbose: true
- name: Select Xcode 16.4
run: |
sudo xcode-select -s /Applications/Xcode_16.4.0.app

- name: Build for Testing
run: |
"$DEV_BUILDS"/build_and_test.sh --action build-for-testing
- name: Test
id: build-for-testing
if: steps.cache-xctestproducts-restore.outputs.cache-hit != 'true'
run: ${{ env.DEV_BUILDS }}/build_and_test.sh --action build-for-testing

- name: Test Without Building
id: test-without-building
if: github.event_name != 'push'
run: |
"$DEV_BUILDS"/build_and_test.sh --action test
run: ${{ env.DEV_BUILDS }}/build_and_test.sh --action test-without-building

- name: Save XCTestProducts
if: failure() && steps.cache-xctestproducts-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ env.XCODE_TEST_PRODUCTS_PATH }}
key: ${{ steps.cache-xctestproducts-restore.outputs.cache-primary-key }}

- name: Log Code Coverage
if: github.event_name != 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
xcrun xccov view --report .build/DevConfiguration_test.xcresult --json \
| ./xccovPretty --github-comment \
> .build/xccovPretty-${{ matrix.platform }}.output
- name: Upload Logs
uses: actions/upload-artifact@v4
gh release download ${{ env.XCCOV_PRETTY_VERSION }} \
--repo DevKitOrganization/xccovPretty \
--pattern "xccovPretty-macos.tar.gz" \
-O - \
| tar -xz
chmod +x xccovPretty

xcrun xccov view --report .build/${XCODE_SCHEME}_test-without-building.xcresult --json \
| ./xccovPretty --github-comment \
> .build/xccovPretty-${{ matrix.platform }}.output

- name: Upload Logs and XCResults
if: success() || failure()
with:
name: Logs-${{ matrix.platform }}
path: .build/*.log
include-hidden-files: true
- name: Upload XCResults
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: XCResults-${{ matrix.platform }}
path: .build/*.xcresult
name: Logs_and_XCResults-${{ matrix.platform }}
path: |
.build/*.log
.build/*.xcresult
include-hidden-files: true

- name: Upload xccovPretty output
if: github.event_name != 'push'
uses: actions/upload-artifact@v4
with:
name: xccovPrettyOutput-${{ matrix.platform }}
path: .build/xccovPretty-${{ matrix.platform }}.output
include-hidden-files: true

post-pr-comments:
name: Post PR Comments
needs: build-and-test
if: ${{ github.event_name == 'pull_request' }}
permissions:
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}

steps:
- name: Download xccovPretty output
uses: actions/download-artifact@v4
with:
name: xccovPrettyOutput-iOS
name: xccovPrettyOutput-macOS

- name: Post Code Coverage Comment
uses: thollander/actions-comment-pull-request@v3
with:
file-path: xccovPretty-iOS.output
comment-tag: codeCoverage-iOS
file-path: xccovPretty-macOS.output
comment-tag: codeCoverage-macOS
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
Open Sourcing/
65 changes: 65 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this
repository.


## Development Commands

### Building and Testing

- **Build**: `swift build`
- **Test all**: `swift test`
- **Test specific target**: `swift test --filter DevConfigurationTests`
- **Test with coverage**: Use Xcode test plans in `Build Support/Test Plans/` (AllTests.xctestplan
for all tests)

### Code Quality

- **Lint**: `Scripts/lint` (uses `swift format lint --recursive --strict`)
- **Format**: `Scripts/format`
- **Setup git hooks**: `Scripts/install-git-hooks` (auto-formats on commit)

### GitHub Actions

The repository uses GitHub Actions for CI/CD with the workflow in
`.github/workflows/VerifyChanges.yaml`. The workflow:

- Lints code on PRs using `swift format`
- Builds and tests on macOS only (other platforms disabled due to GitHub Actions stability)
- Generates code coverage reports using xccovPretty
- Requires Xcode 16.0.1 and macOS 16 runners


## Architecture Overview

DevConfiguration is a type-safe configuration wrapper built on Apple's swift-configuration library.
It provides structured configuration management with telemetry, caching, and extensible metadata.

### Key Documents

- **Architecture Plan.md**: Complete architectural design and technical decisions
- **Implementation Plan.md**: Phased implementation roadmap broken into 6 slices
- **Documentation/TestingGuidelines.md**: Testing standards and patterns
- **Documentation/TestMocks.md**: Mock creation and usage guidelines
- **Documentation/DependencyInjection.md**: Dependency injection patterns
- **Documentation/MarkdownStyleGuide.md**: Documentation formatting standards


## Dependencies

External dependencies managed via Swift Package Manager:

- **swift-configuration** (Apple): Core configuration provider system
- **DevFoundation**: EventBus, utilities, networking
- **DevTesting**: Stub-based testing framework


## Development Notes

- Follows Swift API Design Guidelines
- Uses Swift 6.2 with `ExistentialAny` and `MemberImportVisibility` features enabled
- Minimum deployment targets: iOS, macOS, tvOS, visionOS, and watchOS 26
- All public APIs must be documented and tested
- Test coverage target: >99%
- Implementation follows phased approach in Implementation Plan.md
Loading