From 7e1582d1efc4fe1c9f02aae258ef2a4cf681162c Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 19:40:19 -0300 Subject: [PATCH 1/7] share unit tests schemes --- .../xcschemes/Cache-iOS-Tests.xcscheme | 54 +++++++++++++++ .../xcschemes/Cache-macOS-Tests.xcscheme | 54 +++++++++++++++ .../xcschemes/Cache-tvOS-Tests.xcscheme | 54 +++++++++++++++ .../xcschemes/Cache-watchOS.xcscheme | 67 +++++++++++++++++++ 4 files changed, 229 insertions(+) create mode 100644 Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS-Tests.xcscheme create mode 100644 Cache.xcodeproj/xcshareddata/xcschemes/Cache-macOS-Tests.xcscheme create mode 100644 Cache.xcodeproj/xcshareddata/xcschemes/Cache-tvOS-Tests.xcscheme create mode 100644 Cache.xcodeproj/xcshareddata/xcschemes/Cache-watchOS.xcscheme diff --git a/Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS-Tests.xcscheme b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS-Tests.xcscheme new file mode 100644 index 0000000..0b06974 --- /dev/null +++ b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS-Tests.xcscheme @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Cache.xcodeproj/xcshareddata/xcschemes/Cache-macOS-Tests.xcscheme b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-macOS-Tests.xcscheme new file mode 100644 index 0000000..f1fc19e --- /dev/null +++ b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-macOS-Tests.xcscheme @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Cache.xcodeproj/xcshareddata/xcschemes/Cache-tvOS-Tests.xcscheme b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-tvOS-Tests.xcscheme new file mode 100644 index 0000000..1bd262d --- /dev/null +++ b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-tvOS-Tests.xcscheme @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Cache.xcodeproj/xcshareddata/xcschemes/Cache-watchOS.xcscheme b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-watchOS.xcscheme new file mode 100644 index 0000000..ebce105 --- /dev/null +++ b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-watchOS.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From 7bc1e134eaad425c7445a37cb21ab54b7f157fbc Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 18:22:20 -0300 Subject: [PATCH 2/7] build and test on pull-request --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ Cache.podspec | 2 +- Package.swift | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..45a4f5e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + build-and-test: + runs-on: macos-latest + strategy: + matrix: + schemes: [iOS, macOS, tvOS, watchOS] + build-config: + - { + scheme: "Cache-iOS", + destination: "platform=iOS Simulator,name=iPhone 15", + sdk: "iphonesimulator", + } + - { + scheme: "Cache-tvOS", + destination: "platform=tvOS Simulator,name=Apple TV", + sdk: "appletvsimulator", + } + - { + scheme: "Cache-watchOS", + destination: "platform=watchOS Simulator", + sdk: "watchsimulator", + } + - { + scheme: "Cache-macOS", + destination: "platform=generic/platform=macOS", + sdk: "macosx", + } + steps: + - uses: actions/checkout@v4 + - name: Build + run: | + xcodebuild clean build \ + -workspace 'Cache.xcproject' \ + -scheme '${{ matrix.build-config['scheme'] }}' \ + -sdk '${{ matrix.build-config['sdk'] }}' \ + -destination '${{ matrix.build-config['destination'] }}' + + - name: Execute Unit Tests + run: | + if [ "${{ matrix.build-config['scheme'] }}" == "Cache-watchOS" ]; then + exit 0; + fi + + xcodebuild test \ + -workspace 'Cache.xcproject' \ + -scheme '${{ matrix.build-config['scheme'] }}' \ + -sdk '${{ matrix.build-config['sdk'] }}' \ + -destination '${{ matrix.build-config['destination'] }}' diff --git a/Cache.podspec b/Cache.podspec index c338e03..eb95cab 100644 --- a/Cache.podspec +++ b/Cache.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Cache" s.summary = "Nothing but cache." - s.version = "7.4.0" + s.version = "7.5.0" s.homepage = "https://github.com/hyperoslo/Cache" s.license = 'MIT' s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" } diff --git a/Package.swift b/Package.swift index 30ce2b8..2633a5b 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.5 +// swift-tools-version:5.10 import PackageDescription From ab556afee8bcfa6e1533f389cdeec10718bb8743 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 19:19:36 -0300 Subject: [PATCH 3/7] cd deploy cocoapods --- .github/workflows/cd.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..373578c --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,29 @@ +name: CD + +on: + workflow_dispatch: + push: + tags: + - "*.*.*" + +jobs: + release_version: + name: Release Version + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Deploy to CocoaPods + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + run: | + set -eo pipefail + pod lib lint --allow-warnings + pod trunk push --allow-warnings From 230c21189ee9c12b9ef2530870064e33049b4ed3 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 19:49:13 -0300 Subject: [PATCH 4/7] fix pr workflow --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45a4f5e..3ee3226 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ jobs: runs-on: macos-latest strategy: matrix: - schemes: [iOS, macOS, tvOS, watchOS] build-config: - { scheme: "Cache-iOS", @@ -37,7 +36,7 @@ jobs: - name: Build run: | xcodebuild clean build \ - -workspace 'Cache.xcproject' \ + -project 'Cache.xcodeproj' \ -scheme '${{ matrix.build-config['scheme'] }}' \ -sdk '${{ matrix.build-config['sdk'] }}' \ -destination '${{ matrix.build-config['destination'] }}' @@ -49,7 +48,7 @@ jobs: fi xcodebuild test \ - -workspace 'Cache.xcproject' \ + -project 'Cache.xcodeproj' \ -scheme '${{ matrix.build-config['scheme'] }}' \ -sdk '${{ matrix.build-config['sdk'] }}' \ -destination '${{ matrix.build-config['destination'] }}' From 3a15ebb7c3c8f0f3705974e4fe0e7ea10a410ce7 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 19:52:18 -0300 Subject: [PATCH 5/7] fix macOS tests --- Tests/iOS/Tests/Storage/StorageTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/iOS/Tests/Storage/StorageTests.swift b/Tests/iOS/Tests/Storage/StorageTests.swift index 80f3f18..f42b378 100644 --- a/Tests/iOS/Tests/Storage/StorageTests.swift +++ b/Tests/iOS/Tests/Storage/StorageTests.swift @@ -11,6 +11,7 @@ final class StorageTests: XCTestCase { storage = try! Storage( diskConfig: DiskConfig(name: "Thor"), memoryConfig: MemoryConfig(), + fileManager: FileManager.default, transformer: TransformerFactory.forCodable(ofType: User.self) ) } From 05716251b37a57ab432e2404b34ee8755637685c Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 19:55:38 -0300 Subject: [PATCH 6/7] specify watch simulator to build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ee3226..209eed0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: } - { scheme: "Cache-watchOS", - destination: "platform=watchOS Simulator", + destination: "platform=watchOS Simulator,name=Apple Watch Ultra 2", sdk: "watchsimulator", } - { From ea4c34b23ab36dbc1424af78c0366b682342c9f7 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 6 Dec 2024 13:45:55 -0300 Subject: [PATCH 7/7] Delete .github/workflows/cd.yml --- .github/workflows/cd.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml deleted file mode 100644 index 373578c..0000000 --- a/.github/workflows/cd.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: CD - -on: - workflow_dispatch: - push: - tags: - - "*.*.*" - -jobs: - release_version: - name: Release Version - runs-on: macos-latest - - steps: - - uses: actions/checkout@v4 - - - uses: softprops/action-gh-release@v2 - with: - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Deploy to CocoaPods - env: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} - run: | - set -eo pipefail - pod lib lint --allow-warnings - pod trunk push --allow-warnings