File tree Expand file tree Collapse file tree 6 files changed +78
-5
lines changed
DevCycle-OpenFeature-Provider
Sources/DevCycleOpenFeatureProvider Expand file tree Collapse file tree 6 files changed +78
-5
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Test OpenFeature Provider
2+
3+ on :
4+ pull_request :
5+ branches : [main]
6+ paths :
7+ - " DevCycle-OpenFeature-Provider/**"
8+ - " DevCycle/**"
9+ - " Package.swift"
10+ - " .github/workflows/openfeature-provider.yaml"
11+ - " fastlane/Fastfile"
12+
13+ jobs :
14+ test :
15+ runs-on : macos-latest
16+ steps :
17+ - name : Checkout Project
18+ uses : actions/checkout@v4
19+
20+ - name : " Select Latest Xcode"
21+ uses : maxim-lobanov/setup-xcode@v1
22+ with :
23+ xcode-version : latest-stable
24+
25+ - name : " Carthage Cached Bootstrap"
26+ uses :
DevCycleHQ/[email protected] 27+ with :
28+ github-token : ${{ secrets.AUTOMATION_USER_TOKEN }}
29+ use-xcframeworks : true
30+
31+ - name : Install Ruby Dependencies
32+ run : |
33+ bundle install
34+
35+ # The fastlane task will handle temporarily modifying the Package.swift
36+ # to use the local path reference, and then restoring it afterward
37+ - name : Fastlane OpenFeature Tests
38+ run : bundle exec fastlane openfeature tests
Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ let package = Package(
2020 url: " https://github.com/open-feature/swift-sdk.git " ,
2121 . upToNextMajor( from: " 0.3.0 " )
2222 ) ,
23+ // For local development, fastlane will dynamically update this package reference
24+ // to use the local path. No change needed to this file.
2325 . package (
2426 name: " DevCycle " ,
25- path: " .. "
26- // url: "https://github.com/DevCycleHQ/ios-client-sdk.git",
27- // .upToNextMajor(from: "1.0.0")
27+ url: " https://github.com/DevCycleHQ/ios-client-sdk.git " ,
28+ . upToNextMajor( from: " 1.0.0 " )
2829 ) ,
2930 ] ,
3031 targets: [
Original file line number Diff line number Diff line change @@ -383,7 +383,8 @@ public final class DevCycleProvider: FeatureProvider {
383383 . compactMap { $0 }
384384 . first { !$0. isEmpty }
385385 guard let userId = userId else {
386- Log . error ( " Targeting key or user_id missing from EvaluationContext: \( attributes) " )
386+ Log . error (
387+ " Targeting key or user_id missing from EvaluationContext: \( attributes) " )
387388 throw OpenFeatureError . targetingKeyMissingError
388389 }
389390
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import Foundation
88public class DevCycleOptions {
99 private( set) public var eventFlushIntervalMS : Int ?
1010 private( set) public var disableEventLogging : Bool ?
11- private ( set ) public var logLevel : LogLevel = . error
11+ public var logLevel : LogLevel = . error
1212 private( set) public var enableEdgeDB : Bool = false
1313 private( set) public var disableConfigCache : Bool = false
1414 private( set) public var configCacheTTL : Int = 604_800_000
Original file line number Diff line number Diff line change @@ -114,3 +114,23 @@ platform :mac do
114114 delete_temp_keychain ( keychain_name )
115115 end
116116end
117+
118+ platform :openfeature do
119+ desc "run OpenFeature Provider tests with local override"
120+ lane :tests do
121+ # Create a backup of the original Package.swift
122+ sh ( "cd ../DevCycle-OpenFeature-Provider && cp Package.swift Package.swift.backup" )
123+
124+ begin
125+ # Modify the Package.swift to use the local path instead of URL
126+ sh ( "cd ../DevCycle-OpenFeature-Provider && sed -i '' 's#url: \" https://github.com/DevCycleHQ/ios-client-sdk.git\" #path: \" ..\" #g' Package.swift" )
127+ sh ( "cd ../DevCycle-OpenFeature-Provider && sed -i '' 's#.upToNextMajor(from: \" 1.0.0\" )##g' Package.swift" )
128+
129+ # Run the tests
130+ sh ( "cd ../DevCycle-OpenFeature-Provider && swift test" )
131+ ensure
132+ # Restore the original Package.swift
133+ sh ( "cd ../DevCycle-OpenFeature-Provider && mv Package.swift.backup Package.swift" )
134+ end
135+ end
136+ end
Original file line number Diff line number Diff line change @@ -64,6 +64,19 @@ run mac DevCycle tests
6464
6565----
6666
67+
68+ ## openfeature
69+
70+ ### openfeature tests
71+
72+ ``` sh
73+ [bundle exec] fastlane openfeature tests
74+ ```
75+
76+ run OpenFeature Provider tests with local override
77+
78+ ----
79+
6780This README.md is auto-generated and will be re-generated every time [ _ fastlane_ ] ( https://fastlane.tools ) is run.
6881
6982More information about _ fastlane_ can be found on [ fastlane.tools] ( https://fastlane.tools ) .
You can’t perform that action at this time.
0 commit comments