diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 50ab1cd..ef7bd61 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,12 @@ version: 2 updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly - package-ecosystem: bundler directory: "/" schedule: - interval: weekly - time: "10:00" - timezone: Europe/London - open-pull-requests-limit: 10 - reviewers: - - liamnichols + interval: monthly versioning-strategy: lockfile-only insecure-external-code-execution: allow diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b206b49..27c803f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,58 +6,113 @@ on: pull_request: branches: [ main ] +env: + SCHEME: "swift-user-defaults" + XCODEBUILD: set -o pipefail && env NSUnbufferedIO=YES xcodebuild + jobs: - build: - name: Checks (Xcode ${{ matrix.xcode_version }}) - runs-on: macos-11 + test-macos: + name: Test (macOS, Xcode ${{ matrix.xcode }}) + runs-on: ${{ matrix.macos }} env: - SCHEME: "swift-user-defaults" - DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer' + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' + strategy: + matrix: + xcode: [ 14.3.1, 15.2 ] + include: + - xcode: 14.3.1 + macos: macos-14 + - xcode: 15.2 + macos: macos-14 + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "platform=macOS" clean test | xcbeautify + test-ios: + name: Test (iOS, Xcode ${{ matrix.xcode }}) + runs-on: ${{ matrix.macos }} + env: + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' strategy: matrix: - xcode_version: ['12.5', '13.1'] + xcode: [ 14.3.1, 15.2 ] include: - - xcode_version: '12.5' - destination_ios: 'OS=14.5,name=iPhone 12' - destination_macos: 'platform=macOS' - destination_watchos: 'OS=7.4,name=Apple Watch Series 6 - 44mm' - destination_tvos: 'OS=14.5,name=Apple TV' - - xcode_version: '13.1' - destination_ios: 'OS=15.0,name=iPhone 13' - destination_macos: 'platform=macOS' - destination_watchos: 'OS=8.0,name=Apple Watch Series 7 - 45mm' - destination_tvos: 'OS=15.0,name=Apple TV' + - xcode: 14.3.1 + macos: macos-14 + destination: "platform=iOS Simulator,name=iPhone 14,OS=16.4" + - xcode: 15.2 + macos: macos-14 + destination: "platform=iOS Simulator,name=iPhone 14,OS=17.2" + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify + test-tvos: + name: Test (tvOS, Xcode ${{ matrix.xcode }}) + runs-on: ${{ matrix.macos }} + strategy: + matrix: + xcode: [ 14.3.1, 15.2 ] + include: + - xcode: 14.3.1 + macos: macos-14 + destination: "platform=tvOS Simulator,name=Apple TV,OS=16.4" + - xcode: 15.2 + macos: macos-14 + destination: "platform=tvOS Simulator,name=Apple TV,OS=17.2" + env: + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' steps: - - uses: actions/checkout@v2 + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify - # Setup Ruby and Bundler + test-watchos: + name: Test (watchOS, Xcode ${{ matrix.xcode }}) + runs-on: ${{ matrix.macos }} + strategy: + matrix: + xcode: [ 14.3.1, 15.2 ] + include: + - xcode: 14.3.1 + macos: macos-14 + destination: "platform=watchOS Simulator,name=Apple Watch Series 8 (41mm),OS=9.4" + - xcode: 15.2 + macos: macos-14 + destination: "platform=watchOS Simulator,name=Apple Watch Series 9 (41mm),OS=10.2" + env: + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify + + example: + name: Example Project + runs-on: macos-14 + env: + DEVELOPER_DIR: '/Applications/Xcode_15.2.app/Contents/Developer' + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: UI Test + run: ${{ env.XCODEBUILD }} -workspace "Example/Example.xcworkspace" -scheme "Example" -destination "platform=iOS Simulator,name=iPhone 14,OS=17.2" clean test | xcbeautify + + cocoapods: + name: CocoaPods + runs-on: macos-14 + steps: + - name: Checkout Repo + uses: actions/checkout@v4 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: bundler-cache: true - - # Build library & Run Unit-Tests (MacOS) - - name: Build & Unit-Test Library (MacOS) - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_macos }}" clean test | bundle exec xcpretty - - # Build library & Run Unit-Tests (iOS) - - name: Build & Unit-Test Library (iOS) - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_ios }}" clean test | bundle exec xcpretty - - # Build library & Run Unit-Tests (watchOS) - - name: Build & Unit-Test Library (watchOS) - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_watchos }}" clean test | bundle exec xcpretty - - # Build library & Run Unit-Tests (tvOS) - - name: Build & Unit-Test Library (tvOS) - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_tvos }}" clean test | bundle exec xcpretty - - # Build Example Project & Run UI-Tests (iOS) - - name: Build & UI-Test Example Project (iOS) - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Example/Example.xcworkspace" -scheme "Example" -destination "${{ matrix.destination_ios }}" clean test | bundle exec xcpretty - - # Verify CocoaPods - - name: Verify CocoaPods - run: bundle exec pod lib lint + - name: Lint + run: make lint diff --git a/Example/ExampleUITests/ExampleUITests.swift b/Example/ExampleUITests/ExampleUITests.swift index f30446b..1cac0b9 100644 --- a/Example/ExampleUITests/ExampleUITests.swift +++ b/Example/ExampleUITests/ExampleUITests.swift @@ -41,6 +41,7 @@ class ExampleUITests: XCTestCase { // Type `Locale` doesn't match how we want to represent the `AppleLocale` UserDefault so we'll encode it manually var container = UserDefaults.ValueContainer() container.set(deviceLocale.identifier, forKey: UserDefaults.Key("AppleLocale")) + container.set(deviceLocale.identifier, forKey: UserDefaults.Key("AppleLanguages")) return container.launchArguments } diff --git a/Gemfile b/Gemfile index cb9c2ec..03ee68c 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,3 @@ source "https://rubygems.org" # Cocoapods for iOS dependency management gem 'cocoapods' - -# XCPretty gem for ci workflow output formatting -gem 'xcpretty' diff --git a/Gemfile.lock b/Gemfile.lock index 8aed344..2beb743 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,30 +1,38 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.5) + CFPropertyList (3.0.7) + base64 + nkf rexml - activesupport (6.1.5) + activesupport (7.1.3.2) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) + base64 (0.2.0) + bigdecimal (3.1.7) claide (1.1.0) - cocoapods (1.11.3) + cocoapods (1.15.2) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) + cocoapods-core (= 1.15.2) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -32,10 +40,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.3) - activesupport (>= 5.0, < 7) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.15.2) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -45,7 +53,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.6.3) + cocoapods-downloader (2.1) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -54,41 +62,41 @@ GEM netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + drb (2.2.1) escape (0.0.4) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) - ffi (1.15.5) + ffi (1.16.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.10.0) + i18n (1.14.4) concurrent-ruby (~> 1.0) - json (2.6.1) - minitest (5.15.0) + json (2.7.1) + minitest (5.22.3) molinillo (0.8.0) + mutex_m (0.2.0) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) - public_suffix (4.0.6) - rexml (3.2.5) - rouge (2.0.7) + nkf (0.2.0) + public_suffix (4.0.7) + rexml (3.2.6) ruby-macho (2.5.1) - typhoeus (1.4.0) + typhoeus (1.4.1) ethon (>= 0.9.0) - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - xcodeproj (1.21.0) + xcodeproj (1.24.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) - zeitwerk (2.5.4) PLATFORMS arm64-darwin @@ -97,7 +105,6 @@ PLATFORMS DEPENDENCIES cocoapods - xcpretty BUNDLED WITH 2.2.22 diff --git a/Makefile b/Makefile index 22aa0e9..be7cc4b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ setup: - bundle install + bundle check || bundle install lint: setup bundle exec pod lib lint --allow-warnings diff --git a/Package.swift b/Package.swift index 52afb7b..00ffeec 100644 --- a/Package.swift +++ b/Package.swift @@ -7,9 +7,9 @@ let package = Package( name: "swift-user-defaults", platforms: [ .macOS(.v10_13), - .iOS(.v11), + .iOS(.v12), .watchOS(.v7), - .tvOS(.v11) + .tvOS(.v12) ], products: [ .library(name: "SwiftUserDefaults", targets: ["SwiftUserDefaults"]), diff --git a/swift-user-defaults.podspec b/swift-user-defaults.podspec index 29ca4f6..064d90b 100644 --- a/swift-user-defaults.podspec +++ b/swift-user-defaults.podspec @@ -11,10 +11,8 @@ Pod::Spec.new do |s| s.resource_bundles = {'SwiftUserDefaults' => ['Sources/SwiftUserDefaults/PrivacyInfo.xcprivacy']} s.swift_version = "5.3" - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.13' - s.tvos.deployment_target = '11.0' - s.watchos.deployment_target = '7' # Run Unit Tests s.test_spec 'Tests' do |test_spec|