Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
dde7027
chore: migrate CI and docs to SPM
Copilot Sep 23, 2026
9698423
chore: clean remaining SPM migration config
Copilot Sep 23, 2026
e8efffd
chore: tighten workflow token permissions
Copilot Sep 23, 2026
b25750a
Merge branch 'master' into copilot/remove-cocoapod-support
muzahidul-opti Sep 25, 2026
052e0de
chore: finish CocoaPods removal (FSSDK-11920)
muzahidul-opti Sep 25, 2026
198f235
chore: raise deployment targets to Xcode 27 minimums (FSSDK-11920)
muzahidul-opti Sep 25, 2026
a2f9789
chore: raise DemoSwiftApp deployment targets to Xcode 27 minimums (FS…
muzahidul-opti Sep 25, 2026
7d7431f
chore: restore xcworkspace without Pods/podspec refs (FSSDK-11920)
muzahidul-opti Sep 25, 2026
9024db2
chore: fix whitespace in demo pbxproj left by Pods-group removal (FSS…
muzahidul-opti Sep 25, 2026
196ea05
fix: migrate demo app to UIScene life cycle for iOS/tvOS 27 (FSSDK-11…
muzahidul-opti Sep 25, 2026
0055692
ci: temporarily target PR branch in reusable workflow ref (FSSDK-11920)
muzahidul-opti Sep 28, 2026
8892204
ci: quote matrix os to keep 27.0 a string (FSSDK-11920)
muzahidul-opti Sep 28, 2026
6645d58
ci: replace iPhone 17 Pro with iPhone Air in test matrix (FSSDK-11920)
muzahidul-opti Sep 28, 2026
eaac098
ci: name unit-test step, drop unused coveralls-lcov gem (FSSDK-11920)
muzahidul-opti Sep 28, 2026
404bfcf
ci: auto-retry flaky unit-test jobs twice (FSSDK-11920)
muzahidul-opti Sep 28, 2026
811ca97
build: raise watchOS minimum to 9.0 (FSSDK-11920)
muzahidul-opti Sep 28, 2026
a21ef42
ci: fix PR review follow-ups
Copilot Sep 28, 2026
f8dbd11
ci: drop dead scripts, harden coveralls step (FSSDK-11920)
muzahidul-opti Sep 29, 2026
990ab4f
ci: gather coverage from test targets on Xcode 27 (FSSDK-11920)
muzahidul-opti Sep 29, 2026
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
1 change: 0 additions & 1 deletion .github/workflows/source_clear_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ jobs:
env:
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
run: |
gem install cocoapods -v '1.15.2'
curl -sSL https://download.sourceclear.com/ci.sh | bash -s - scan
34 changes: 12 additions & 22 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
type: boolean
description: release

permissions:
contents: read

env:
VERSION: 5.5.0

Expand All @@ -30,31 +33,26 @@ jobs:
secrets:
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}

lint:
runs-on: macos-14
package_validation:
runs-on: xcode-27
if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}"
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.3
- env:
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
run: |
gem install cocoapods -v '1.15.2'
pod spec lint --quick --allow-warnings
swift package resolve
swift build
curl -sSL https://download.sourceclear.com/ci.sh | bash

unittests:
if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}"
uses: optimizely/swift-sdk/.github/workflows/unit_tests.yml@master
uses: ./.github/workflows/unit_tests.yml
prepare_for_release:
runs-on: macos-14
runs-on: xcode-27
if: "${{ github.event.inputs.PREP == 'true' && github.event_name == 'workflow_dispatch' }}"
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.3
- name: Install Hub by Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand All @@ -67,34 +65,26 @@ jobs:
BRANCH: ${{ github.ref_name }}
GITHUB_USER: optibot
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
COCOAPODS_VERSION: '1.15.2'
run: |
gem install cocoapods -v $COCOAPODS_VERSION
Scripts/run_prep.sh
- name: Check prepare for release failure
if: steps.prepare_for_release.conclusion == 'failure'
run: cat /tmp/build.out

release:
if: "${{github.event.inputs.RELEASE == 'true' && github.event_name == 'workflow_dispatch' }}"
runs-on: macos-14
runs-on: xcode-27
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.3
- name: Install Hub by Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install hub
- name: Push to cocoapods.org
- name: Publish GitHub release
env:
HOME: 'home/runner'
REPO_SLUG: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_VERSION: '1.15.2'
run: |
gem install cocoapods -v $COCOAPODS_VERSION
Scripts/run_release.sh
75 changes: 31 additions & 44 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,45 @@ name: Reusable action of Unit tests

on: [workflow_call]

permissions:
contents: read

env:
COVERAGE_DIR: ./COVERAGE

jobs:
unittests:
runs-on: macos-14
runs-on: xcode-27
strategy:
fail-fast: false
matrix:
# github actions are very poor in supporting iOS simulators:
# - multiple Xcode versions are pre installed (not all versions and they change supported xcode versions frequently)
# - each xcode version has own simulator os versions.
# - so to run tests with the target simulator, we have to find a proper xcode version pre-installed and support the target simulator os version.
# also, the xcode version (simulator_xcode_version) and simulator os versions (os) are moving target. We have to change these time to time.
# - see "https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md" for installed macOS, xcode and simulator versions.
include:
- os: 17.2
device: "iPhone 15"
- os: "27.0"
device: "iPhone 17"
scheme: "OptimizelySwiftSDK-iOS"
test_sdk: "iphonesimulator"
platform: "iOS Simulator"
os_type: "iOS"
simulator_xcode_version: 15.3
- os: 17.4
device: "iPad Pro 11-inch (M4)"
- os: "27.0"
device: "iPad Pro 11-inch (M5)"
scheme: "OptimizelySwiftSDK-iOS"
test_sdk: "iphonesimulator"
platform: "iOS Simulator"
os_type: "iOS"
simulator_xcode_version: 15.3
- os: 18.2
device: "iPhone 16"
- os: "27.0"
device: "iPhone Air"
scheme: "OptimizelySwiftSDK-iOS"
test_sdk: "iphonesimulator"
platform: "iOS Simulator"
os_type: "iOS"
simulator_xcode_version: 15.3
- os: 17.5
device: "Apple TV"
- os: "27.0"
device: "Apple TV 4K (3rd generation)"
scheme: "OptimizelySwiftSDK-tvOS"
test_sdk: "appletvsimulator"
platform: "tvOS Simulator"
os_type: "tvOS"
simulator_xcode_version: 15.3
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
# macos version and supported simulator_xcode_versions are all related to this xcode_version, so be careful when you upgrade this.
xcode-version: 15.3
- name: set SDK Branch if PR
env:
BASE_REF: ${{ github.base_ref }}
Expand All @@ -65,43 +54,40 @@ jobs:
run: |
echo "BRANCH=$REF_NAME" >> $GITHUB_ENV
- id: unit_tests
name: Run unit tests
# ponytail: retry masks flaky async-ordering tests; remove when they're deracinated
env:
SCHEME: ${{ matrix.scheme }}
TEST_SDK: ${{ matrix.test_sdk }}
PLATFORM: ${{ matrix.platform }}
OS: ${{ matrix.os }}
OS_TYPE: ${{ matrix.os_type }}
SIMULATOR_XCODE_VERSION: ${{ matrix.simulator_xcode_version }}
NAME: ${{ matrix.device }}
run: |
gem install coveralls-lcov
gem install cocoapods -v '1.15.2'
pod repo update
pod install
HOMEBREW_NO_INSTALL_CLEANUP=true brew update && brew install jq

# github actions are very poor in supporting iOS simulators:
# - to find pre-installed xcode version, run this:
##ls /Applications/
# - to find supported simulator os versions, run this (and find simulator with non-error "datapath")
# xcrun simctl list --json devices
for attempt in 1 2 3; do
if Scripts/run_unit_tests.sh; then
exit 0
fi

# switch to the target xcode version
sudo xcode-select -switch /Applications/Xcode_$SIMULATOR_XCODE_VERSION.app
if [ "$attempt" -lt 3 ]; then
echo "Unit tests failed on attempt $attempt; retrying..."
rm -rf build "$COVERAGE_DIR"
fi
done

Scripts/prepare_simulator.sh
Scripts/run_unit_tests.sh
exit 1
- name: Check on failures (Archive Test Results)
uses: actions/upload-artifact@v4
if: steps.unit_tests.outcome != 'success'
with:
name: build-logs-${{ matrix.device }}-${{ matrix.os }}
path: build/Logs
- # - report coverage for PR and iPhone 16 only (avoid redundant ones)
# - use Xcode16+ (older Xcode reports a wrong number)
name: Check on success
# - report coverage for the main iPhone simulator job only (avoid redundant ones)
- name: Check on success
id: coveralls
if: ${{ steps.unit_tests.outcome == 'success' && env.BRANCH == 'master' && env.PLATFORM == 'iOS Simulator' && env.NAME == 'iPhone 16' }}
if: ${{ steps.unit_tests.outcome == 'success' && env.BRANCH == 'master' && env.PLATFORM == 'iOS Simulator' && env.NAME == 'iPhone 17' }}
# coverage is informational; a broken report must not fail the test job
continue-on-error: true
env:
PLATFORM: ${{ matrix.platform }}
NAME: ${{ matrix.device }}
Expand All @@ -110,7 +96,8 @@ jobs:
sleep 5
- name: Upload coveralls report
if: steps.coveralls.outcome == 'success'
uses: coverallsapp/github-action@master
continue-on-error: true
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./xccov2lcov/lcov.info
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ build
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
Pods/

# COCOAPODS version at the end of Podfile.lock requires all stick to the same version
# Ignore this and stick pods to fixed versions in Podfile
Podfile.lock

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Expand Down
2 changes: 0 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ disabled_rules:
opt_in_rules:
- empty_string
excluded:
- Carthage
- Pods
- SwiftLint/Common/3rdPartyLib
- Tests
line_length:
Expand Down
54 changes: 23 additions & 31 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@ This is the Optimizely Swift SDK for Feature Experimentation and Full Stack. It
## Getting Started

### Platform Support
- iOS 10.0+
- tvOS 10.0+
- watchOS 3.0+
- iOS 15.0+
- tvOS 15.0+
- watchOS 9.0+
- Swift 5+

### Installation Methods
- Swift Package Manager (preferred)
- CocoaPods
- Swift Package Manager

### Dependencies
- SwiftLint (development)

### Initial Setup
```bash
# Install dependencies
pod install

# Build the SDK
swift build

# Verify setup (see "Testing" section for detailed commands)
swift test
xcodebuild test \
-project OptimizelySwiftSDK.xcodeproj \
-scheme OptimizelySwiftSDK-iOS \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=27.0'
```

## Project Structure
Expand Down Expand Up @@ -124,33 +123,33 @@ The SDK uses protocols for extensibility:

#### Using Swift Package Manager
```bash
# Run all tests
swift test
# Resolve package dependencies
swift package resolve

# Run with verbose output
swift test --verbose
# Build the package
swift build
```

#### Using Xcode
```bash
# Run all tests for iOS
xcodebuild test \
-workspace OptimizelySwiftSDK.xcworkspace \
-project OptimizelySwiftSDK.xcodeproj \
-scheme OptimizelySwiftSDK-iOS \
-destination 'platform=iOS Simulator,name=iPhone 16'
-destination 'platform=iOS Simulator,name=iPhone 17,OS=27.0'

# Run a specific test target
xcodebuild test \
-workspace OptimizelySwiftSDK.xcworkspace \
-project OptimizelySwiftSDK.xcodeproj \
-scheme OptimizelySwiftSDK-iOS \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=27.0' \
-only-testing:TestTarget/TestClass

# Run a specific test method
xcodebuild test \
-workspace OptimizelySwiftSDK.xcworkspace \
-project OptimizelySwiftSDK.xcodeproj \
-scheme OptimizelySwiftSDK-iOS \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=27.0' \
-only-testing:TestTarget/TestClass/testMethodName
```

Expand Down Expand Up @@ -186,7 +185,7 @@ Similar test targets exist for tvOS and other platforms.
- Add PBXFileReference entry (~line 2640)
- Add to file group listing (~line 3180)
- Add to PBXSourcesBuildPhase for each target (~lines 5200, 5510)
4. Verify: `swift build && swift test --filter YourTestClass`
4. Verify with `xcodebuild test -project OptimizelySwiftSDK.xcodeproj -scheme OptimizelySwiftSDK-iOS -only-testing:YourTestTarget/YourTestClass -destination 'platform=iOS Simulator,name=iPhone 17,OS=27.0'`

**Pattern**: Common tests need 2 targets (iOS + tvOS); base classes may need 4 targets.

Expand Down Expand Up @@ -308,16 +307,10 @@ Month Day, Year
- ✅ Include: New features, bug fixes, API changes, breaking changes
- ❌ Exclude: Internal refactoring, test improvements, CI updates, documentation changes

**File 3: `README.md`** (Line ~42)
```diff
-```pod 'OptimizelySwiftSDK', '~> 5.2.0'```
+```pod 'OptimizelySwiftSDK', '~> 5.2.1'```
```

#### 4. Create Release Commit
```bash
# Stage all changes
git add .github/workflows/swift.yml CHANGELOG.md README.md
git add .github/workflows/swift.yml CHANGELOG.md

# Create release commit
git commit -m "chore: prepare release X.Y.Z
Expand Down Expand Up @@ -345,7 +338,7 @@ Prepare for Release X.Y.Z: [Brief description of changes]
#### 6. After PR Merge
After the release PR is merged to master:
1. Maintainers will tag the release
2. GitHub Actions will build and publish to CocoaPods
2. GitHub Actions will publish the GitHub release
3. Release notes will be published automatically

### Example Release PRs
Expand All @@ -356,7 +349,6 @@ After the release PR is merged to master:
- [ ] Created release branch: `prepare-release-X.Y.Z`
- [ ] Updated VERSION in `.github/workflows/swift.yml`
- [ ] Added release notes to `CHANGELOG.md` (user-facing changes only)
- [ ] Updated version in `README.md`
- [ ] Created commit with message: `chore: prepare release X.Y.Z`
- [ ] Created PR with proper title and description
- [ ] All CI tests passing
Expand Down Expand Up @@ -446,9 +438,9 @@ git merge origin/master
xcrun simctl list devices available

# List schemes and build targets
xcodebuild -workspace OptimizelySwiftSDK.xcworkspace -list
xcodebuild -project OptimizelySwiftSDK.xcodeproj -list

# Show build settings for a scheme
xcodebuild -workspace OptimizelySwiftSDK.xcworkspace \
xcodebuild -project OptimizelySwiftSDK.xcodeproj \
-scheme OptimizelySwiftSDK-iOS -showBuildSettings
```
Loading
Loading