From 9b9935f0cb605f4e05d9f96e6445ce4348c3e3f2 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 11:59:22 +0100 Subject: [PATCH 01/58] Update workflows machine version --- .github/workflows/build.yml | 4 ++-- .github/workflows/format_project.yml | 2 +- .github/workflows/pr_scan.yml | 2 +- .github/workflows/publich_podspec.yml | 2 +- .github/workflows/publish-demo-app.yml | 2 +- .github/workflows/regenerate-docs.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/test-SPM-integration.yml | 2 +- .github/workflows/test-carthage-integration.yml | 2 +- .github/workflows/test_cocoapods_integration.yml | 2 +- .github/workflows/update-version.yml | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52dd2d4c88..cfbac28075 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: tests: - runs-on: macos-12 + runs-on: macos-14 continue-on-error: true strategy: fail-fast: false @@ -65,7 +65,7 @@ jobs: destination: ${{ matrix.destination }} sonar: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 diff --git a/.github/workflows/format_project.yml b/.github/workflows/format_project.yml index dfc27fea7d..838b651675 100644 --- a/.github/workflows/format_project.yml +++ b/.github/workflows/format_project.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Update: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 9e3acb8626..1ad54e299b 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -9,7 +9,7 @@ jobs: build: env: sonarToken: ${{ secrets.SONAR_TOKEN }} - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publich_podspec.yml b/.github/workflows/publich_podspec.yml index a224683ee0..34ed92f64b 100644 --- a/.github/workflows/publich_podspec.yml +++ b/.github/workflows/publich_podspec.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: publish: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-demo-app.yml b/.github/workflows/publish-demo-app.yml index 0525eac6b0..dd95c67825 100644 --- a/.github/workflows/publish-demo-app.yml +++ b/.github/workflows/publish-demo-app.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Publish: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/regenerate-docs.yml b/.github/workflows/regenerate-docs.yml index ca331a10a9..adda91ffcd 100644 --- a/.github/workflows/regenerate-docs.yml +++ b/.github/workflows/regenerate-docs.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Generate: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 2f6ab2dd1d..4c73e8dd7e 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -12,7 +12,7 @@ on: jobs: setup: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index 9449f72fb9..94cba384d2 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -12,7 +12,7 @@ on: jobs: SPM: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 885fcbe4a3..0d85206a5d 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -12,7 +12,7 @@ on: jobs: carthage: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index 29ef70e86e..99e360958c 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -12,7 +12,7 @@ on: jobs: pods: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index d8e5d8a0fd..140d157c61 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -8,7 +8,7 @@ on: jobs: Update: - runs-on: macos-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 with: From db18e01e57427a05c0a7392f8d673890d4077a2c Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 13:38:53 +0100 Subject: [PATCH 02/58] Update device destinations --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfbac28075..1b6580c61c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +16,39 @@ jobs: fail-fast: false matrix: include: - - destination: 'name=iPhone 11 Pro' - scheme: AdyenUIHost - - destination: 'name=iPhone-6,OS=11.4' - scheme: AdyenUIHost - - destination: 'name=iPhone-X,OS=12.4' - scheme: AdyenUIKitTests - - destination: 'name=iPhone 8,OS=13.7' - scheme: AdyenUIHost + + - version: '17.2' + runtime: 'iOS-17-2' + device: 'iPhone 15' + displayname: 'iPhone-15' + os: 'macos-14-xlarge' + xcode_version: '15.1' + needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15 + + - version: '17.2' + runtime: 'iOS-17-2' + device: 'iPad Air (5th generation)' + displayname: 'iPad-Air-5' + os: 'macos-14-xlarge' + xcode_version: '15.1' + needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15 + + - version: '16.4' + runtime: 'iOS-16-4' + device: 'iPhone 14' + displayname: 'iPhone-14' + os: 'macos-13' + xcode_version: '14.3' + needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 14 + + # - destination: 'name=iPhone 11 Pro' + # scheme: AdyenUIHost + # - destination: 'name=iPhone-6,OS=11.4' + # scheme: AdyenUIHost + # - destination: 'name=iPhone-X,OS=12.4' + # scheme: AdyenUIKitTests + # - destination: 'name=iPhone 8,OS=13.7' + # scheme: AdyenUIHost steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 From 54fd011b517db18e65d692db6969c383d1e8a7e7 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 13:45:33 +0100 Subject: [PATCH 03/58] Update device destination in PR Scan job --- .github/workflows/pr_scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 1ad54e299b..cf913cdf10 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -46,7 +46,7 @@ jobs: project: 'Adyen.xcodeproj' params: '-derivedDataPath ./DerivedData -enableCodeCoverage YES' scheme: 'AdyenUIHost' - destination: 'name=iPhone 11' + destination: 'name=iPhone 15' - name: Slather run: | From 4ab7e6142e16f3bcede3c17fc574f76a3ebd09c4 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 13:49:16 +0100 Subject: [PATCH 04/58] Update device destination in PR Scan job --- .github/workflows/pr_scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index cf913cdf10..7816824942 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -46,7 +46,7 @@ jobs: project: 'Adyen.xcodeproj' params: '-derivedDataPath ./DerivedData -enableCodeCoverage YES' scheme: 'AdyenUIHost' - destination: 'name=iPhone 15' + destination: 'name=iPhone-15' - name: Slather run: | From 10003f1f9059e51b41fe252446e968cd58e3e65f Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 13:57:15 +0100 Subject: [PATCH 05/58] Update device destination in PR Scan job --- .github/workflows/pr_scan.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 7816824942..aba1152de1 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -43,11 +43,10 @@ jobs: xcodebuild -version xcodebuild clean build test -project "${project}" -scheme "${scheme}" ${params} -destination "${destination}" | xcpretty && exit ${PIPESTATUS[0]} env: + destination: "name=iPhone 15 Pro,OS=17.2" project: 'Adyen.xcodeproj' params: '-derivedDataPath ./DerivedData -enableCodeCoverage YES' scheme: 'AdyenUIHost' - destination: 'name=iPhone-15' - - name: Slather run: | slather coverage --sonarqube-xml ${params} ${project} From 6a96fc64c9b88dcc9bc6dbf19b7b07e439009b27 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 14:05:26 +0100 Subject: [PATCH 06/58] Update Xcode version --- .github/workflows/pr_scan.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index aba1152de1..6c325a4571 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -9,7 +9,10 @@ jobs: build: env: sonarToken: ${{ secrets.SONAR_TOKEN }} - runs-on: macos-14 + destination: "name=iPhone 15 Pro,OS=17.2" + project: "Adyen.xcodeproj" + params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" + runs-on: macos-14-xlarge # Apple Silicon Runner steps: - uses: actions/checkout@v3 @@ -23,7 +26,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '15.1' - name: Install Tools run: | @@ -43,9 +46,7 @@ jobs: xcodebuild -version xcodebuild clean build test -project "${project}" -scheme "${scheme}" ${params} -destination "${destination}" | xcpretty && exit ${PIPESTATUS[0]} env: - destination: "name=iPhone 15 Pro,OS=17.2" - project: 'Adyen.xcodeproj' - params: '-derivedDataPath ./DerivedData -enableCodeCoverage YES' + params: '${{env.params}}' scheme: 'AdyenUIHost' - name: Slather run: | From 00acaa245a650d456b9da2de376167f7e3575530 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 14:14:45 +0100 Subject: [PATCH 07/58] Update Xcode version --- .github/workflows/test-carthage-integration.yml | 4 ++-- .github/workflows/test_cocoapods_integration.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 0d85206a5d..6f8722e640 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -12,7 +12,7 @@ on: jobs: carthage: - runs-on: macos-14 + runs-on: macos-14-xlarge # Apple Silicon Runner steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Resolve dependencies run: | diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index 99e360958c..cf326c6d6d 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '15.3' - name: Lint Cocoapods run: | From 6e5149dee0676f655e03c4b0423be1c48534cc04 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 14:27:48 +0100 Subject: [PATCH 08/58] Try macos-13 on SPM job --- .github/workflows/test-SPM-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index 94cba384d2..8181527baa 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -12,7 +12,7 @@ on: jobs: SPM: - runs-on: macos-14 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '15.3' - name: Test Swift Package Manager Integration run: | From 1bbc15603020a9793f3042b41050db63b88c2b03 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 14:29:44 +0100 Subject: [PATCH 09/58] Update CI --- .github/workflows/test-SPM-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index 8181527baa..58c5e1b795 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.3' + xcode-version: '15.2.0' - name: Test Swift Package Manager Integration run: | From 509992a1e3a68e8d3434df03f15eb38486c25d9a Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 14:42:01 +0100 Subject: [PATCH 10/58] Update CI --- .github/workflows/test-carthage-integration.yml | 4 ++-- .github/workflows/test_cocoapods_integration.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 6f8722e640..623951949a 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -12,7 +12,7 @@ on: jobs: carthage: - runs-on: macos-14-xlarge # Apple Silicon Runner + runs-on: macos-13 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.1' + xcode-version: '15.2.0' - name: Resolve dependencies run: | diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index cf326c6d6d..75557c5639 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -12,7 +12,7 @@ on: jobs: pods: - runs-on: macos-14 + runs-on: macos-3 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.3' + xcode-version: '15.2.0' - name: Lint Cocoapods run: | From d7b677fdc4fe47f7fb597e58f38a256c4f6c4c61 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 15:02:01 +0100 Subject: [PATCH 11/58] Update CI --- .github/workflows/test_cocoapods_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index 75557c5639..4277c06cdd 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -12,7 +12,7 @@ on: jobs: pods: - runs-on: macos-3 + runs-on: macos-13 steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 From efa7c428d5534c3d7c539cb3fa4073c54d8c16ea Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 15:18:57 +0100 Subject: [PATCH 12/58] Update CI --- Scripts/test-CocoaPods-integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/test-CocoaPods-integration.sh b/Scripts/test-CocoaPods-integration.sh index 7e837fc8ec..c2cc810e80 100755 --- a/Scripts/test-CocoaPods-integration.sh +++ b/Scripts/test-CocoaPods-integration.sh @@ -75,7 +75,7 @@ let package = Package( swift package update -swift package generate-xcodeproj +xcodegen generate # Create a Podfile with our pod as dependency. From db632e55f1495d9abddf8f7bb225acd2ff29c6c9 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 15:43:34 +0100 Subject: [PATCH 13/58] Update CI --- Scripts/test-CocoaPods-integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/test-CocoaPods-integration.sh b/Scripts/test-CocoaPods-integration.sh index c2cc810e80..7e837fc8ec 100755 --- a/Scripts/test-CocoaPods-integration.sh +++ b/Scripts/test-CocoaPods-integration.sh @@ -75,7 +75,7 @@ let package = Package( swift package update -xcodegen generate +swift package generate-xcodeproj # Create a Podfile with our pod as dependency. From 6637eb7a942fd9be7d6bae6220e0d4c8a1898c91 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 15:56:13 +0100 Subject: [PATCH 14/58] Update CI --- .github/workflows/test-carthage-integration.yml | 4 ++-- .github/workflows/test_cocoapods_integration.yml | 7 +++++-- Scripts/test-CocoaPods-integration.sh | 4 +--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 623951949a..c70cd69f37 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -12,7 +12,7 @@ on: jobs: carthage: - runs-on: macos-13 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.2.0' + xcode-version: '16.1' - name: Resolve dependencies run: | diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index 4277c06cdd..6c022042e5 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -12,7 +12,7 @@ on: jobs: pods: - runs-on: macos-13 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 @@ -22,11 +22,14 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.2.0' + xcode-version: '15.3' - name: Lint Cocoapods run: | + brew update + brew install xcodegen gem install cocoapods -v 1.10.2 + pod repo update pod lib lint Adyen.podspec --allow-warnings --verbose - name: Test Cocoapods Integration diff --git a/Scripts/test-CocoaPods-integration.sh b/Scripts/test-CocoaPods-integration.sh index 7e837fc8ec..1d2589e02f 100755 --- a/Scripts/test-CocoaPods-integration.sh +++ b/Scripts/test-CocoaPods-integration.sh @@ -73,9 +73,7 @@ let package = Package( " > Package.swift -swift package update - -swift package generate-xcodeproj +xcodegen generate # Create a Podfile with our pod as dependency. From 5171927d0a08f6ea83cb42c50b9b07922aaec3b6 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 16:08:27 +0100 Subject: [PATCH 15/58] Update CI --- .github/workflows/test-carthage-integration.yml | 7 +++---- Scripts/carthage.sh | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index c70cd69f37..dfc481b9b1 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -6,15 +6,14 @@ on: push: branches: - - master - develop jobs: carthage: - runs-on: macos-14-xlarge + runs-on: macos-14-xlarge # Apple Silicon Runner steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: n1hility/cancel-previous-runs@v3 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -35,4 +34,4 @@ jobs: GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | carthage version - Scripts/test-carthage-integration.sh + Scripts/test-carthage-integration.sh \ No newline at end of file diff --git a/Scripts/carthage.sh b/Scripts/carthage.sh index 92d70d58f7..29051519c0 100755 --- a/Scripts/carthage.sh +++ b/Scripts/carthage.sh @@ -31,4 +31,4 @@ export XCODE_XCCONFIG_FILE="$xcconfig" IS_STATIC_ARGUMENT="--static" ALL_ARGUMENTS="$@" ARGUMENTS=$(echo $ALL_ARGUMENTS | sed -e "s/$IS_STATIC_ARGUMENT//") -/usr/local/bin/carthage $ARGUMENTS +/usr/local/bin/carthage $ARGUMENTS \ No newline at end of file From c6e893af45ecd99935f398d41fd6ffb3f82c5a30 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 16:21:01 +0100 Subject: [PATCH 16/58] Update CI --- .../workflows/test_cocoapods_integration.yml | 5 +- Scripts/test-CocoaPods-integration.sh | 101 ++++++++++++------ 2 files changed, 68 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index 6c022042e5..53b6ac8fdc 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -6,7 +6,6 @@ on: push: branches: - - master - develop jobs: @@ -14,7 +13,7 @@ jobs: pods: runs-on: macos-14-xlarge steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: n1hility/cancel-previous-runs@v3 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -35,4 +34,4 @@ jobs: - name: Test Cocoapods Integration run: | Scripts/test-CocoaPods-integration.sh -w - Scripts/test-CocoaPods-integration.sh + Scripts/test-CocoaPods-integration.sh \ No newline at end of file diff --git a/Scripts/test-CocoaPods-integration.sh b/Scripts/test-CocoaPods-integration.sh index 1d2589e02f..cc451307f0 100755 --- a/Scripts/test-CocoaPods-integration.sh +++ b/Scripts/test-CocoaPods-integration.sh @@ -41,37 +41,41 @@ rm -rf $PROJECT_NAME mkdir -p $PROJECT_NAME && cd $PROJECT_NAME -# Create a new Xcode project. -swift package init - -# Create the Package.swift. -echo "// swift-tools-version:5.3 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: \"TempProject\", - platforms: [ - .iOS(.v12) - ], - products: [ - .library( - name: \"TempProject\", - targets: [\"TempProject\"]), - ], - dependencies: [], - targets: [ - .target( - name: \"TempProject\", - dependencies: []), - .testTarget( - name: \"TempProjectTests\", - dependencies: [\"TempProject\"]), - ] -) - -" > Package.swift +echo " +name: $PROJECT_NAME +targets: + $PROJECT_NAME: + type: application + platform: iOS + sources: Source + settings: + base: + PRODUCT_BUNDLE_IDENTIFIER: com.adyen.$PROJECT_NAME + Tests: + type: bundle.ui-testing + platform: iOS + sources: Tests +schemes: + TempProject-Package: + build: + targets: + $PROJECT_NAME: all + Tests: [tests] + test: + targets: + - Tests +" > project.yml + +mkdir -p Source + +echo " +import Foundation +import Adyen +@main +class EmptyClass {static func main() {}} +" > Source/EmptyClass.swift + +mkdir -p Tests xcodegen generate @@ -85,8 +89,22 @@ then use_frameworks! pod 'Adyen', :path => '../' + pod 'Adyen/Session', :path => '../' pod 'Adyen/SwiftUI', :path => '../' + pod 'Adyen/DelegatedAuthentication', :path => '../' + pod 'Adyen/CashAppPay', :path => '../' + pod 'Adyen/AdyenTwint', :path => '../' end + + post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = \"\" + config.build_settings['CODE_SIGNING_REQUIRED'] = \"NO\" + config.build_settings['CODE_SIGNING_ALLOWED'] = \"NO\" + end + end + end " >> Podfile else echo "platform :ios, '12.0' @@ -97,6 +115,19 @@ else pod 'Adyen', :path => '../' pod 'Adyen/WeChatPay', :path => '../' pod 'Adyen/SwiftUI', :path => '../' + pod 'AdyenAuthentication' + pod 'Adyen/CashAppPay', :path => '../' + pod 'Adyen/AdyenTwint', :path => '../' + end + + post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = \"\" + config.build_settings['CODE_SIGNING_REQUIRED'] = \"NO\" + config.build_settings['CODE_SIGNING_ALLOWED'] = \"NO\" + end + end end " >> Podfile fi @@ -106,16 +137,16 @@ pod install # Archive for generic iOS device echo '############# Archive for generic iOS device ###############' -xcodebuild archive -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS' +xcodebuild -quiet archive -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO GENERATE_INFOPLIST_FILE=YES # Build for generic iOS device echo '############# Build for generic iOS device ###############' -xcodebuild clean build -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS' +xcodebuild -quiet clean build -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO GENERATE_INFOPLIST_FILE=YES # Archive for x86_64 simulator echo '############# Archive for simulator ###############' -xcodebuild archive -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS Simulator' +xcodebuild -quiet archive -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS Simulator' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO GENERATE_INFOPLIST_FILE=YES # Build for x86_64 simulator echo '############# Build for simulator ###############' -xcodebuild clean build -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS Simulator' +xcodebuild -quiet clean build -scheme TempProject-Package -workspace TempProject.xcworkspace -destination 'generic/platform=iOS Simulator' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO GENERATE_INFOPLIST_FILE=YES \ No newline at end of file From 9746d5e8638cde348a0e976bed47d35a5070ea39 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 16:41:28 +0100 Subject: [PATCH 17/58] Update CI --- Scripts/test-CocoaPods-integration.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Scripts/test-CocoaPods-integration.sh b/Scripts/test-CocoaPods-integration.sh index cc451307f0..05a0308bdb 100755 --- a/Scripts/test-CocoaPods-integration.sh +++ b/Scripts/test-CocoaPods-integration.sh @@ -89,11 +89,7 @@ then use_frameworks! pod 'Adyen', :path => '../' - pod 'Adyen/Session', :path => '../' pod 'Adyen/SwiftUI', :path => '../' - pod 'Adyen/DelegatedAuthentication', :path => '../' - pod 'Adyen/CashAppPay', :path => '../' - pod 'Adyen/AdyenTwint', :path => '../' end post_install do |installer| @@ -115,9 +111,6 @@ else pod 'Adyen', :path => '../' pod 'Adyen/WeChatPay', :path => '../' pod 'Adyen/SwiftUI', :path => '../' - pod 'AdyenAuthentication' - pod 'Adyen/CashAppPay', :path => '../' - pod 'Adyen/AdyenTwint', :path => '../' end post_install do |installer| From 2dc6bff788ac042d87ad1462edec9e6a1100ff15 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 17:04:02 +0100 Subject: [PATCH 18/58] Update CI --- .github/workflows/test-carthage-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index dfc481b9b1..9c984530ce 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -27,6 +27,7 @@ jobs: run: | brew update brew install xcodegen + brew install carthage brew upgrade carthage - name: Test Carthage Integration From a077f096f79c3ca22e338b9208b193110e04ae4a Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 17:05:48 +0100 Subject: [PATCH 19/58] Update CI From 14e5fd63f481873d0740a908f4cabf05dc789bb9 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Wed, 15 Jan 2025 17:05:56 +0100 Subject: [PATCH 20/58] Update CI From bb467f9dbb6f15c54bd9231e462da9f96d74236d Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Thu, 16 Jan 2025 11:46:56 +0100 Subject: [PATCH 21/58] Update CI --- Scripts/carthage.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Scripts/carthage.sh b/Scripts/carthage.sh index 29051519c0..6daca70074 100755 --- a/Scripts/carthage.sh +++ b/Scripts/carthage.sh @@ -31,4 +31,15 @@ export XCODE_XCCONFIG_FILE="$xcconfig" IS_STATIC_ARGUMENT="--static" ALL_ARGUMENTS="$@" ARGUMENTS=$(echo $ALL_ARGUMENTS | sed -e "s/$IS_STATIC_ARGUMENT//") + + +# Find and print the location of Carthage +CARTHAGE_PATH=$(which carthage) + +if [ -z "$CARTHAGE_PATH" ]; then + echo "Carthage is not installed or not in the PATH." +else + echo "Carthage is located at: $CARTHAGE_PATH" +fi + /usr/local/bin/carthage $ARGUMENTS \ No newline at end of file From 7c73feaf1ca8f10e62a6aef3fa1aa61244cad305 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Thu, 16 Jan 2025 11:50:03 +0100 Subject: [PATCH 22/58] Update CI From be5daaa1b285592108bd784321672796e6f24595 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Thu, 16 Jan 2025 11:55:04 +0100 Subject: [PATCH 23/58] Update CI --- Scripts/carthage.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Scripts/carthage.sh b/Scripts/carthage.sh index 6daca70074..1c0ac240f5 100755 --- a/Scripts/carthage.sh +++ b/Scripts/carthage.sh @@ -33,13 +33,16 @@ ALL_ARGUMENTS="$@" ARGUMENTS=$(echo $ALL_ARGUMENTS | sed -e "s/$IS_STATIC_ARGUMENT//") -# Find and print the location of Carthage +# Find the Carthage binary CARTHAGE_PATH=$(which carthage) if [ -z "$CARTHAGE_PATH" ]; then echo "Carthage is not installed or not in the PATH." -else - echo "Carthage is located at: $CARTHAGE_PATH" + exit 1 fi -/usr/local/bin/carthage $ARGUMENTS \ No newline at end of file +# Use the found Carthage binary to run commands +echo "Using Carthage located at: $CARTHAGE_PATH" + +# Example: Running Carthage update +"$CARTHAGE_PATH" $ARGUMENTS \ No newline at end of file From a41f8c92de0686151722febd9c27d7e389630477 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Thu, 16 Jan 2025 12:49:57 +0100 Subject: [PATCH 24/58] Update CI --- Scripts/test-carthage-integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/test-carthage-integration.sh b/Scripts/test-carthage-integration.sh index 5f3f8be50e..0207168350 100755 --- a/Scripts/test-carthage-integration.sh +++ b/Scripts/test-carthage-integration.sh @@ -125,7 +125,7 @@ cp "../Demo/Configuration.swift" Source/Configuration.swift xcodegen generate echo_header "Run Tests" -xcodebuild build test -project $PROJECT_NAME.xcodeproj -scheme App -destination "name=iPhone 13" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild build test -project $PROJECT_NAME.xcodeproj -scheme App -destination "name=iPhone 16" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]} if [ "$NEED_CLEANUP" == true ] then From 3a20ea3270c5c2e2746708c78acba62477b2c78a Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Thu, 16 Jan 2025 13:17:36 +0100 Subject: [PATCH 25/58] Update CI --- .github/workflows/build.yml | 36 +++++++++---------- .github/workflows/format_project.yml | 4 +-- .github/workflows/pr_scan.yml | 4 +-- .github/workflows/publich_podspec.yml | 4 +-- .github/workflows/publish-demo-app.yml | 4 +-- .github/workflows/regenerate-docs.yml | 4 +-- .github/workflows/spell-check.yml | 2 +- .github/workflows/test-SPM-integration.yml | 4 +-- .../workflows/test-carthage-integration.yml | 3 +- .../workflows/test_cocoapods_integration.yml | 3 +- .github/workflows/update-version.yml | 4 +-- 11 files changed, 37 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b6580c61c..6bc521e1ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,36 +10,36 @@ on: jobs: tests: - runs-on: macos-14 + runs-on: macos-14-xlarge continue-on-error: true strategy: fail-fast: false matrix: include: - - version: '17.2' - runtime: 'iOS-17-2' - device: 'iPhone 15' - displayname: 'iPhone-15' + - version: '18.1' + runtime: 'iOS-18-1' + device: 'iPhone 16' + displayname: 'iPhone-16' os: 'macos-14-xlarge' - xcode_version: '15.1' - needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15 + xcode_version: '16.1' + needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 - - version: '17.2' - runtime: 'iOS-17-2' - device: 'iPad Air (5th generation)' - displayname: 'iPad-Air-5' + - version: '18.1' + runtime: 'iOS-18-1' + device: 'iPad (10th generation)' + displayname: 'iPad-10th-generation' os: 'macos-14-xlarge' - xcode_version: '15.1' - needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15 + xcode_version: '16.1' + needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 - version: '16.4' runtime: 'iOS-16-4' device: 'iPhone 14' displayname: 'iPhone-14' - os: 'macos-13' - xcode_version: '14.3' - needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 14 + os: 'macos-14-xlarge' + xcode_version: '16.1' + needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 # - destination: 'name=iPhone 11 Pro' # scheme: AdyenUIHost @@ -90,7 +90,7 @@ jobs: destination: ${{ matrix.destination }} sonar: - runs-on: macos-14 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 @@ -109,7 +109,7 @@ jobs: project: 'Adyen.xcodeproj' params: '-derivedDataPath ./DerivedData -enableCodeCoverage YES' scheme: AdyenUIHost - destination: 'name=iPhone 11' + destination: 'name=iPhone 16' - name: Slather run: | diff --git a/.github/workflows/format_project.yml b/.github/workflows/format_project.yml index 838b651675..43c2b7ae58 100644 --- a/.github/workflows/format_project.yml +++ b/.github/workflows/format_project.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Update: - runs-on: macos-14 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v4 with: @@ -15,7 +15,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Format project run: | diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 6c325a4571..75761d0554 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -9,7 +9,7 @@ jobs: build: env: sonarToken: ${{ secrets.SONAR_TOKEN }} - destination: "name=iPhone 15 Pro,OS=17.2" + destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" runs-on: macos-14-xlarge # Apple Silicon Runner @@ -26,7 +26,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.1' + xcode-version: '16.1' - name: Install Tools run: | diff --git a/.github/workflows/publich_podspec.yml b/.github/workflows/publich_podspec.yml index 34ed92f64b..b49211eddd 100644 --- a/.github/workflows/publich_podspec.yml +++ b/.github/workflows/publich_podspec.yml @@ -3,14 +3,14 @@ on: [workflow_dispatch] jobs: publish: - runs-on: macos-14 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Publish Adyen.podspec run: | diff --git a/.github/workflows/publish-demo-app.yml b/.github/workflows/publish-demo-app.yml index dd95c67825..1c39030eb6 100644 --- a/.github/workflows/publish-demo-app.yml +++ b/.github/workflows/publish-demo-app.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Publish: - runs-on: macos-14 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 with: @@ -15,7 +15,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Install the Apple certificate and provisioning profile env: diff --git a/.github/workflows/regenerate-docs.yml b/.github/workflows/regenerate-docs.yml index adda91ffcd..aebc79c3c4 100644 --- a/.github/workflows/regenerate-docs.yml +++ b/.github/workflows/regenerate-docs.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Generate: - runs-on: macos-14 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 with: @@ -15,7 +15,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Generate Docs run: | diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 4c73e8dd7e..1087ce66db 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -12,7 +12,7 @@ on: jobs: setup: - runs-on: macos-14 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index 58c5e1b795..c618add167 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -12,7 +12,7 @@ on: jobs: SPM: - runs-on: macos-13 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.2.0' + xcode-version: '16.1' - name: Test Swift Package Manager Integration run: | diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 9c984530ce..649326843e 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -6,12 +6,13 @@ on: push: branches: + - master - develop jobs: carthage: - runs-on: macos-14-xlarge # Apple Silicon Runner + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v4 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index 53b6ac8fdc..32b0c107b4 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -6,6 +6,7 @@ on: push: branches: + - master - develop jobs: @@ -21,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.3' + xcode-version: '16.1' - name: Lint Cocoapods run: | diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 140d157c61..a712962e83 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -8,7 +8,7 @@ on: jobs: Update: - runs-on: macos-14 + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 with: @@ -20,7 +20,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Update version number run: | From 262a28c52681cf4b553f2e2775078c484ca15be8 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Thu, 16 Jan 2025 16:55:14 +0100 Subject: [PATCH 26/58] Update unit tests --- .../3DS2/ThreeDS2ComponentFingerprint.swift | 8 ++-- .../Adyen Tests/Utilities/CoderTests.swift | 39 ++++++++++++------- .../ThreeDS2ClassicActionHandlerTests.swift | 38 ++++++++++++++---- 3 files changed, 61 insertions(+), 24 deletions(-) diff --git a/AdyenActions/Components/3DS2/ThreeDS2ComponentFingerprint.swift b/AdyenActions/Components/3DS2/ThreeDS2ComponentFingerprint.swift index 3995adc198..c4cf9ff157 100644 --- a/AdyenActions/Components/3DS2/ThreeDS2ComponentFingerprint.swift +++ b/AdyenActions/Components/3DS2/ThreeDS2ComponentFingerprint.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2022 Adyen N.V. +// Copyright (c) 2019 Adyen N.V. // // This file is open source and available under the MIT license. See the LICENSE file for more info. // @@ -9,8 +9,8 @@ import Foundation internal extension ThreeDS2Component { - struct Fingerprint: Encodable { // swiftlint:disable:this explicit_acl - + struct Fingerprint: Encodable, Equatable { // swiftlint:disable:this explicit_acl + private let deviceInformation: String? private let sdkEphemeralPublicKey: EphemeralPublicKey? private let sdkReferenceNumber: String? @@ -55,7 +55,7 @@ internal extension ThreeDS2Component { extension ThreeDS2Component.Fingerprint { - internal struct EphemeralPublicKey: Codable { + internal struct EphemeralPublicKey: Codable, Equatable { private let keyType: String private let curve: String diff --git a/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift b/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift index fba2e15c48..6c3483d326 100644 --- a/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift +++ b/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift @@ -28,21 +28,34 @@ class CoderTests: XCTestCase { XCTAssertEqual(sampleObject.nestedObject.nestedValue, "value") } - func testEncodeToString() { - let encodedString = try! Coder.encode(sampleObject) as String - - XCTAssertEqual(encodedString, sampleObjectRawString) + func testEncodeToString() throws { + // Given + let expectedObject = sampleObject + + // When + let encodedString = try XCTUnwrap(try? Coder.encode(expectedObject) as String) + + // Then + let dataFromString = try XCTUnwrap(encodedString.data(using: .utf8)) + let receivedObject: SampleObject = try XCTUnwrap(try? Coder.decode(dataFromString)) + XCTAssertEqual(expectedObject, receivedObject) } - func testEncodeToData() { - let encodedData = try! Coder.encode(sampleObject) as Data - let expectedData = sampleObjectRawString.data(using: .utf8) - - XCTAssertEqual(encodedData, expectedData) + func testEncodeToData() throws { + // Given + let objectData = try XCTUnwrap(sampleObjectRawString.data(using: .utf8)) + let expectedObject: SampleObject = try XCTUnwrap(try? Coder.decode(objectData)) + + // When + let encodedData = try XCTUnwrap(try? Coder.encode(sampleObject) as Data) + + // Then + let receivedObject: SampleObject = try XCTUnwrap(try? Coder.decode(encodedData)) + XCTAssertEqual(expectedObject, receivedObject) } - + // MARK: - Private - + private let sampleObjectRawString = "{\"nested\":{\"nestedValue\":\"value\"},\"string\":\"someString\",\"some_integer\":99,\"date\":\"2015-02-28T21:30:00Z\"}" private lazy var sampleObject: SampleObject = { @@ -51,7 +64,7 @@ class CoderTests: XCTestCase { return SampleObject(string: "someString", integer: 99, date: date, nestedObject: nestedObject) }() - private struct SampleObject: Decodable, Encodable { + private struct SampleObject: Codable, Equatable { var string: String var integer: Int var date: Date @@ -65,7 +78,7 @@ class CoderTests: XCTestCase { } } - private struct NestedObject: Decodable, Encodable { + private struct NestedObject: Codable, Equatable { var nestedValue: String enum CodingKeys: String, CodingKey { diff --git a/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift b/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift index c5058096e3..79535b1e9b 100644 --- a/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift +++ b/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift @@ -44,7 +44,7 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { func testWrappedComponent() { let sut = ThreeDS2ClassicActionHandler(apiContext: Dummy.context, appearanceConfiguration: ADYAppearanceConfiguration()) XCTAssertEqual(sut.wrappedComponent.apiContext.clientKey, Dummy.context.clientKey) - + XCTAssertEqual(sut.wrappedComponent.apiContext.environment.baseURL, Dummy.context.environment.baseURL) sut._isDropIn = false @@ -55,15 +55,15 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { } func testFingerprintFlowSuccess() throws { - + let service = AnyADYServiceMock() service.authenticationRequestParameters = authenticationRequestParameters - + let fingerprint = try ThreeDS2Component.Fingerprint( authenticationRequestParameters: authenticationRequestParameters ) - let expectedFingerprint = try Coder.encodeBase64(fingerprint) - + let expectedFingerprintJSON = try Coder.encode(fingerprint) as String + let resultExpectation = expectation(description: "Expect ThreeDS2ActionHandler completion closure to be called.") let sut = ThreeDS2ClassicActionHandler(apiContext: Dummy.context, service: service) sut.handle(fingerprintAction) { fingerprintResult in @@ -75,7 +75,12 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { let details = details as! ThreeDS2Details switch details { case let .fingerprint(fingerprint): - XCTAssertEqual(fingerprint, expectedFingerprint) + if let data = Data(base64Encoded: fingerprint), + let receivedFingerprintJSON = String(data: data, encoding: .utf8) { + XCTAssertTrue(self.compareJSONStrings(expectedFingerprintJSON, receivedFingerprintJSON)) + } else { + XCTFail() + } default: XCTFail() } @@ -87,7 +92,7 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { } resultExpectation.fulfill() } - + waitForExpectations(timeout: 2, handler: nil) } @@ -269,4 +274,23 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { waitForExpectations(timeout: 2, handler: nil) } + // MARK: - Private + + func compareJSONStrings(_ jsonString1: String, _ jsonString2: String) -> Bool { + guard let data1 = jsonString1.data(using: .utf8), + let data2 = jsonString2.data(using: .utf8) else { + print("Invalid data.") + return false + } + + do { + let dict1 = try JSONSerialization.jsonObject(with: data1, options: [.allowFragments]) as? [String: Any] + let dict2 = try JSONSerialization.jsonObject(with: data2, options: [.allowFragments]) as? [String: Any] + + return NSDictionary(dictionary: dict1 ?? [:]).isEqual(to: dict2 ?? [:]) + } catch { + print("Error decoding JSON: \(error)") + return false + } + } } From c636fe7e162a76b0ec56829ea4d8b08b649f7293 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Fri, 17 Jan 2025 15:31:40 +0100 Subject: [PATCH 27/58] Update CI --- .github/workflows/build.yml | 9 --------- .github/workflows/test-SPM-integration.yml | 2 +- .github/workflows/test-carthage-integration.yml | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bc521e1ab..6140c97cac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,15 +40,6 @@ jobs: os: 'macos-14-xlarge' xcode_version: '16.1' needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 - - # - destination: 'name=iPhone 11 Pro' - # scheme: AdyenUIHost - # - destination: 'name=iPhone-6,OS=11.4' - # scheme: AdyenUIHost - # - destination: 'name=iPhone-X,OS=12.4' - # scheme: AdyenUIKitTests - # - destination: 'name=iPhone 8,OS=13.7' - # scheme: AdyenUIHost steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index c618add167..2e2eb31ec6 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.1' + xcode-version: latest-stable - name: Test Swift Package Manager Integration run: | diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 649326843e..331b939483 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.1' + xcode-version: latest-stable - name: Resolve dependencies run: | From 71e7d1bbe3535008b52d1b92924fed3f39bfe63c Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 17 Jan 2025 15:37:59 +0100 Subject: [PATCH 28/58] switching to Void? for AssociatedKeys (#1950) # Summary - Switching to `Void?` for `AssociatedKey`s as described [here](https://github.com/atrick/swift-evolution/blob/diagnose-implicit-raw-bitwise/proposals/nnnn-implicit-raw-bitwise-conversion.md#workarounds-for-common-cases) - Removing superfluous `swiftlint:disable` # Ticket COIOS-000 Co-authored-by: Alex Guretzki --- Adyen/Core/Components/Base/Component.swift | 8 ++++---- Adyen/Core/Components/Base/PaymentComponent.swift | 6 +++--- Adyen/Helpers/UIViewAnimation.swift | 2 +- Adyen/UI/Form/Items/Address/AddressViewModel.swift | 4 ++-- Adyen/Utilities/Observable/Observer.swift | 4 ++-- Demo/Common/Helpers/APIClientHelper.swift | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Adyen/Core/Components/Base/Component.swift b/Adyen/Core/Components/Base/Component.swift index d21ae05c0a..1543093c97 100644 --- a/Adyen/Core/Components/Base/Component.swift +++ b/Adyen/Core/Components/Base/Component.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2022 Adyen N.V. +// Copyright (c) 2019 Adyen N.V. // // This file is open source and available under the MIT license. See the LICENSE file for more info. // @@ -78,9 +78,9 @@ public extension Component { } private enum AssociatedKeys { - internal static var isDropIn = "isDropInObject" + internal static var isDropIn: Void? - internal static var environment = "environmentObject" + internal static var environment: Void? - internal static var clientKey = "clientKeyObject" + internal static var clientKey: Void? } diff --git a/Adyen/Core/Components/Base/PaymentComponent.swift b/Adyen/Core/Components/Base/PaymentComponent.swift index 4a794899d9..b69741a883 100644 --- a/Adyen/Core/Components/Base/PaymentComponent.swift +++ b/Adyen/Core/Components/Base/PaymentComponent.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2022 Adyen N.V. +// Copyright (c) 2019 Adyen N.V. // // This file is open source and available under the MIT license. See the LICENSE file for more info. // @@ -96,7 +96,7 @@ extension PaymentAwareComponent { private enum AssociatedKeys { - internal static var payment = "paymentObject" + internal static var payment: Void? - internal static var order = "orderObject" + internal static var order: Void? } diff --git a/Adyen/Helpers/UIViewAnimation.swift b/Adyen/Helpers/UIViewAnimation.swift index 2f004819ad..4e94d497ad 100644 --- a/Adyen/Helpers/UIViewAnimation.swift +++ b/Adyen/Helpers/UIViewAnimation.swift @@ -7,7 +7,7 @@ import UIKit private enum AssociatedKeys { - internal static var animations = "animations" + internal static var animations: Void? } /// :nodoc: diff --git a/Adyen/UI/Form/Items/Address/AddressViewModel.swift b/Adyen/UI/Form/Items/Address/AddressViewModel.swift index 38219d8928..f87a93c46f 100644 --- a/Adyen/UI/Form/Items/Address/AddressViewModel.swift +++ b/Adyen/UI/Form/Items/Address/AddressViewModel.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2022 Adyen N.V. +// Copyright (c) 2021 Adyen N.V. // // This file is open source and available under the MIT license. See the LICENSE file for more info. // @@ -49,7 +49,7 @@ public struct AddressViewModel { /// :nodoc: public private(set) var schema: [FormScheme] - // swiftlint:disable function_body_length explicit_acl + // swiftlint:disable function_body_length internal static subscript(context: AddressViewModelBuilderContext) -> AddressViewModel { var viewModel = AddressViewModel(labels: [.city: .cityFieldTitle, .houseNumberOrName: .houseNumberFieldTitle, diff --git a/Adyen/Utilities/Observable/Observer.swift b/Adyen/Utilities/Observable/Observer.swift index c2d43ce675..14397e7f72 100644 --- a/Adyen/Utilities/Observable/Observer.swift +++ b/Adyen/Utilities/Observable/Observer.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2021 Adyen N.V. +// Copyright (c) 2019 Adyen N.V. // // This file is open source and available under the MIT license. See the LICENSE file for more info. // @@ -161,6 +161,6 @@ public extension Observer { private enum AssociatedKeys { /// The observation manager associated with the object. - public static var observationManager = "observationManager" + public static var observationManager: Void? } diff --git a/Demo/Common/Helpers/APIClientHelper.swift b/Demo/Common/Helpers/APIClientHelper.swift index dc3ae6c08c..c8132337ab 100644 --- a/Demo/Common/Helpers/APIClientHelper.swift +++ b/Demo/Common/Helpers/APIClientHelper.swift @@ -48,5 +48,5 @@ extension APIClientAware { } private enum AssociatedKeys { - internal static var apiClient = "apiClient" + internal static var apiClient: Void? } From 8d986c0ae74157ae38f094c2dcc6dddc1a807c76 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Fri, 17 Jan 2025 15:39:37 +0100 Subject: [PATCH 29/58] Update CI --- .github/workflows/test-carthage-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 331b939483..649326843e 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Resolve dependencies run: | From 4124a1e85894a75906bc13600b84eaa9f77e85d3 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Fri, 17 Jan 2025 15:40:07 +0100 Subject: [PATCH 30/58] Update CI From 293dbfaa13486bb6fc39901702387fc6d9553f89 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Fri, 17 Jan 2025 15:40:31 +0100 Subject: [PATCH 31/58] Update CI From 5cd4648a1b81770a144f330ba32210debabef5f4 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 12:04:40 +0100 Subject: [PATCH 32/58] Update CI --- .github/workflows/test-SPM-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index 2e2eb31ec6..c618add167 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -22,7 +22,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.1' - name: Test Swift Package Manager Integration run: | From b6eb8039b444bb334726560bdde43de428a74868 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 12:14:58 +0100 Subject: [PATCH 33/58] Update encoder output formatting --- Adyen/Utilities/Coder.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Adyen/Utilities/Coder.swift b/Adyen/Utilities/Coder.swift index d792f8203c..0ec714914e 100644 --- a/Adyen/Utilities/Coder.swift +++ b/Adyen/Utilities/Coder.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2021 Adyen N.V. +// Copyright (c) 2019 Adyen N.V. // // This file is open source and available under the MIT license. See the LICENSE file for more info. // @@ -70,7 +70,8 @@ public enum Coder { private static let encoder: JSONEncoder = { let encoder = JSONEncoder() encoder.dateEncodingStrategy = .iso8601 - + encoder.outputFormatting = .sortedKeys + return encoder }() From 22db5eb65c66a19fa0da84a5716ced8235614016 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 13:24:48 +0100 Subject: [PATCH 34/58] Add encodeWithSortedKeys to JSONEncoder --- Adyen.xcodeproj/project.pbxproj | 4 ++++ .../JSONEncoder+SortedKeys.swift.swift | 19 +++++++++++++++++++ AdyenEncryption/Payload/Payload.swift | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 AdyenEncryption/Extensions/JSONEncoder+SortedKeys.swift.swift diff --git a/Adyen.xcodeproj/project.pbxproj b/Adyen.xcodeproj/project.pbxproj index d210c7b9bc..395d8f0d2f 100644 --- a/Adyen.xcodeproj/project.pbxproj +++ b/Adyen.xcodeproj/project.pbxproj @@ -124,6 +124,7 @@ C978F5EF2732CD6A00F59B3C /* FormCardSecurityCodeItemViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C978F5EE2732CD6A00F59B3C /* FormCardSecurityCodeItemViewTests.swift */; }; C982FFD826946F0800AED849 /* AffirmComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C982FFD726946F0800AED849 /* AffirmComponent.swift */; }; C982FFDC2694792F00AED849 /* AffirmPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = C982FFDB2694792F00AED849 /* AffirmPaymentMethod.swift */; }; + C9B506C32D3E776200AAE686 /* JSONEncoder+SortedKeys.swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9B506C22D3E776200AAE686 /* JSONEncoder+SortedKeys.swift.swift */; }; C9BB460427622D9B00E6730B /* BACSConfirmationViewProtocolMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9BB460327622D9B00E6730B /* BACSConfirmationViewProtocolMock.swift */; }; C9BB460627622E9600E6730B /* BACSConfirmationPresenterProtocolMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9BB460527622E9600E6730B /* BACSConfirmationPresenterProtocolMock.swift */; }; C9BB460927622F4100E6730B /* BACSConfirmationPresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9BB460827622F4100E6730B /* BACSConfirmationPresenterTests.swift */; }; @@ -1066,6 +1067,7 @@ C978F5EE2732CD6A00F59B3C /* FormCardSecurityCodeItemViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormCardSecurityCodeItemViewTests.swift; sourceTree = ""; }; C982FFD726946F0800AED849 /* AffirmComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AffirmComponent.swift; sourceTree = ""; }; C982FFDB2694792F00AED849 /* AffirmPaymentMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AffirmPaymentMethod.swift; sourceTree = ""; }; + C9B506C22D3E776200AAE686 /* JSONEncoder+SortedKeys.swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "JSONEncoder+SortedKeys.swift.swift"; sourceTree = ""; }; C9BB460327622D9B00E6730B /* BACSConfirmationViewProtocolMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BACSConfirmationViewProtocolMock.swift; sourceTree = ""; }; C9BB460527622E9600E6730B /* BACSConfirmationPresenterProtocolMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BACSConfirmationPresenterProtocolMock.swift; sourceTree = ""; }; C9BB460827622F4100E6730B /* BACSConfirmationPresenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BACSConfirmationPresenterTests.swift; sourceTree = ""; }; @@ -2661,6 +2663,7 @@ E736497E25277B6500AB76AE /* StringExtension.swift */, E736498125277B9100AB76AE /* DataExtension.swift */, E736498325277BAA00AB76AE /* IntegerExtension.swift */, + C9B506C22D3E776200AAE686 /* JSONEncoder+SortedKeys.swift.swift */, ); path = Extensions; sourceTree = ""; @@ -5461,6 +5464,7 @@ E74517A425FB834C000BDCCF /* EncryptedCard.swift in Sources */, F9F1A98F26CD15C30005CB1D /* RSAOAEP256Algorithm.swift in Sources */, A0414C342791D9EC00DF3FE9 /* BankDetailsEncryptor.swift in Sources */, + C9B506C32D3E776200AAE686 /* JSONEncoder+SortedKeys.swift.swift in Sources */, F9F1A98926CD0CCF0005CB1D /* CommonCryptoHelpers.swift in Sources */, E745179925FB8340000BDCCF /* Card.swift in Sources */, F92326BD25A366D9002C5BC4 /* CardPayload.swift in Sources */, diff --git a/AdyenEncryption/Extensions/JSONEncoder+SortedKeys.swift.swift b/AdyenEncryption/Extensions/JSONEncoder+SortedKeys.swift.swift new file mode 100644 index 0000000000..5e17e207a3 --- /dev/null +++ b/AdyenEncryption/Extensions/JSONEncoder+SortedKeys.swift.swift @@ -0,0 +1,19 @@ +// +// JSONEncoder+Extensions.swift +// AdyenEncryption +// +// Created by Naufal Aros on 20/01/2025. +// Copyright © 2025 Adyen. All rights reserved. +// + +import Foundation + +extension JSONEncoder { + internal static func encodeWithSortedKeys(_ encodable: Encodable) throws -> Data { + let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .iso8601 + encoder.outputFormatting = .sortedKeys + + return try encoder.encode(encodable) + } +} diff --git a/AdyenEncryption/Payload/Payload.swift b/AdyenEncryption/Payload/Payload.swift index 088ac7b824..eae6bc3310 100644 --- a/AdyenEncryption/Payload/Payload.swift +++ b/AdyenEncryption/Payload/Payload.swift @@ -12,6 +12,6 @@ internal protocol Payload: Encodable { extension Payload { internal func jsonData() throws -> Data { - try JSONEncoder().encode(self) + try JSONEncoder.encodeWithSortedKeys(self) } } From c3b3ae7f8a915cb59873f4d5901a0f750412d794 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 13:28:25 +0100 Subject: [PATCH 35/58] Update JSONWebEncryptionGenerator to use sorted keys encoding --- .../JSON Web Encryption/JSONWebEncryptionGenerator.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AdyenEncryption/JOSE/Encryption Algorithms/JSON Web Encryption/JSONWebEncryptionGenerator.swift b/AdyenEncryption/JOSE/Encryption Algorithms/JSON Web Encryption/JSONWebEncryptionGenerator.swift index 756290a457..f3ada2bb19 100644 --- a/AdyenEncryption/JOSE/Encryption Algorithms/JSON Web Encryption/JSONWebEncryptionGenerator.swift +++ b/AdyenEncryption/JOSE/Encryption Algorithms/JSON Web Encryption/JSONWebEncryptionGenerator.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2023 Adyen N.V. +// Copyright (c) 2025 Adyen N.V. // // This file is open source and available under the MIT license. See the LICENSE file for more info. // @@ -22,8 +22,8 @@ internal struct JSONWebEncryptionGenerator: AnyJSONWebEncryptionGenerator { let contentEncryptionKey = try generateRandomData(length: contentEncryptionAlgorithm.keyLength) let encryptedKey = try keyEncryptionAlgorithm.encrypt(contentEncryptionKey, withKey: publicRSAKey) - let encodedHeader = try JSONEncoder().encode(header) - + let encodedHeader = try JSONEncoder.encodeWithSortedKeys(header) + let initializationVector = try generateRandomData(length: contentEncryptionAlgorithm.initializationVectorLength) guard let additionalAuthenticationData = encodedHeader.base64URLString().data(using: .ascii) else { throw EncryptionError.encryptionFailed From efe3a402edbbd47b85a3ca7904bd794793d4ba09 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 14:01:13 +0100 Subject: [PATCH 36/58] Fix testEncryptBIN test --- .../Card Tests/Utilities/CardEncryptorCardTests.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tests/AdyenTests/Card Tests/Utilities/CardEncryptorCardTests.swift b/Tests/AdyenTests/Card Tests/Utilities/CardEncryptorCardTests.swift index c6a501c1b7..0ad6358cfe 100644 --- a/Tests/AdyenTests/Card Tests/Utilities/CardEncryptorCardTests.swift +++ b/Tests/AdyenTests/Card Tests/Utilities/CardEncryptorCardTests.swift @@ -185,9 +185,8 @@ class CardEncryptorCardTests: XCTestCase { } } - func testEncryptBIN() { - let encrypted = try! CardEncryptor.encrypt(bin: "55000000", with: Dummy.publicKey) - XCTAssertNotNil(encrypted) - XCTAssertTrue(encrypted.hasPrefix("eyJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwiYWxnIjoiUlNBLU9BRVAtMjU2IiwidmVyc2lvbiI6IjEifQ")) + func testEncryptBIN() throws { + let encrypted = try XCTUnwrap(CardEncryptor.encrypt(bin: "55000000", with: Dummy.publicKey)) + XCTAssertTrue(encrypted.hasPrefix("eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwidmVyc2lvbiI6IjEifQ")) } } From 7a0d9f32189306a99c5ce19bdd10a0d66508c768 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 14:05:26 +0100 Subject: [PATCH 37/58] Fix testKCP test --- Tests/AdyenTests/Card Tests/CardComponentTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/AdyenTests/Card Tests/CardComponentTests.swift b/Tests/AdyenTests/Card Tests/CardComponentTests.swift index e5dfd8a8a3..bf26c07e11 100644 --- a/Tests/AdyenTests/Card Tests/CardComponentTests.swift +++ b/Tests/AdyenTests/Card Tests/CardComponentTests.swift @@ -1101,9 +1101,9 @@ class CardComponentTests: XCTestCase { XCTAssertTrue(component === sut) let paymentDetails = data.paymentMethod as? CardDetails XCTAssertNotNil(paymentDetails) - + XCTAssertNotEqual(paymentDetails?.password, "12") - XCTAssertTrue(paymentDetails!.password!.starts(with: "eyJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwiYWxnIjoiUlNBLU9BRVAtMjU2IiwidmVyc2lvbiI6IjEifQ")) + XCTAssertTrue(paymentDetails!.password!.starts(with: "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwidmVyc2lvbiI6IjEifQ")) XCTAssertEqual(paymentDetails?.taxNumber, "121212") sut.stopLoadingIfNeeded() From c0b9acf4f67a5b3435c5d3b080aa91c1df7fffb3 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 14:25:49 +0100 Subject: [PATCH 38/58] Install swiftlint --- .github/workflows/pr_scan.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 75761d0554..34ec6c5c9c 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -68,6 +68,7 @@ jobs: - name: SwiftLint run: | + brew install swiftlint fastlane run swiftlint output_file:"./reports/swiftlint.json" reporter:"json" ignore_exit_status:"true" - name: Run Sonar From 1f869733e67eb0505cd49709c5acbb3ca1de9925 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 14:37:34 +0100 Subject: [PATCH 39/58] Update sonar phase --- .github/workflows/pr_scan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 34ec6c5c9c..fadca26809 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -71,10 +71,10 @@ jobs: brew install swiftlint fastlane run swiftlint output_file:"./reports/swiftlint.json" reporter:"json" ignore_exit_status:"true" - - name: Run Sonar + - name: 📡 Run Sonar if: ${{ env.sonarToken != 0 }} run: | git fetch --unshallow --no-tags - sonar-scanner -Dsonar.login=${{ secrets.SONAR_TOKEN }} + sonar-scanner -Dsonar.token=${{ secrets.SONAR_TOKEN }} -Dsonar.coverageReportPaths=sonarqube_updated_CI.xml,sonarqube_updated_snapshots.xml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2be338164dddc8e0eac1f3f487b91e9d579cd641 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 14:52:29 +0100 Subject: [PATCH 40/58] Remove Java version configuration --- .github/workflows/pr_scan.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index fadca26809..a438a96c33 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -12,17 +12,17 @@ jobs: destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" - runs-on: macos-14-xlarge # Apple Silicon Runner + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-java@v1 - with: - java-version: '11' - + # - uses: actions/setup-java@v1 + # with: + # java-version: '11' + - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: From f50cf4a236d6cc2d84b455a2e9b164674b373c40 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 15:10:20 +0100 Subject: [PATCH 41/58] Update PR scan job --- .github/workflows/pr_scan.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index a438a96c33..9c980202e9 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -12,7 +12,7 @@ jobs: destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" - runs-on: macos-14-xlarge + runs-on: macos-14-xlarge # Apple Silicon Runner steps: - uses: actions/checkout@v3 @@ -22,7 +22,7 @@ jobs: # - uses: actions/setup-java@v1 # with: # java-version: '11' - + - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: @@ -71,10 +71,10 @@ jobs: brew install swiftlint fastlane run swiftlint output_file:"./reports/swiftlint.json" reporter:"json" ignore_exit_status:"true" - - name: 📡 Run Sonar + - name: Run Sonar if: ${{ env.sonarToken != 0 }} run: | git fetch --unshallow --no-tags - sonar-scanner -Dsonar.token=${{ secrets.SONAR_TOKEN }} -Dsonar.coverageReportPaths=sonarqube_updated_CI.xml,sonarqube_updated_snapshots.xml + sonar-scanner -Dsonar.login=${{ secrets.SONAR_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e2033f49f80e873b675f621c44aca8ce170d903b Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 15:58:24 +0100 Subject: [PATCH 42/58] Update PR scan job --- .github/workflows/pr_scan.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 9c980202e9..ff47ed9de8 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -19,9 +19,9 @@ jobs: - uses: n1hility/cancel-previous-runs@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - # - uses: actions/setup-java@v1 - # with: - # java-version: '11' + - uses: actions/setup-java@v1 + with: + java-version: '17' - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 From af9975a6240cb90acac5c242da6c5339181e6315 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 17:12:33 +0100 Subject: [PATCH 43/58] Create base environment --- .github/workflows/base-env.yml | 14 ++++++++++++++ .github/workflows/build.yml | 2 +- .github/workflows/pr_scan.yml | 4 +++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/base-env.yml diff --git a/.github/workflows/base-env.yml b/.github/workflows/base-env.yml new file mode 100644 index 0000000000..56b79553ea --- /dev/null +++ b/.github/workflows/base-env.yml @@ -0,0 +1,14 @@ +name: Base Environment Workflow + +on: + workflow_call: + +env: + XCODE_VERSION: '16.1' # Define the Xcode version here + +jobs: + setup: + runs-on: macos-latest + steps: + - name: Print Xcode version + run: echo "The selected Xcode version is $XCODE_VERSION" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6140c97cac..a8cec1f8ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 with: - java-version: '11' + java-version: '17' - name: Install Dependencies run: | diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index ff47ed9de8..6405dde180 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -7,6 +7,8 @@ on: jobs: build: + uses: ./base-env.yml + env: sonarToken: ${{ secrets.SONAR_TOKEN }} destination: "name=iPhone 16 Pro,OS=18.1" @@ -26,7 +28,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.1' + xcode-version: ${XCODE_VERSION} - name: Install Tools run: | From 508de6cae99e29c18c8bac6193dbcfd53285be03 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 17:20:01 +0100 Subject: [PATCH 44/58] Update PR Scan workflow --- .github/workflows/base-env.yml | 2 +- .github/workflows/pr_scan.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base-env.yml b/.github/workflows/base-env.yml index 56b79553ea..2d2daa7982 100644 --- a/.github/workflows/base-env.yml +++ b/.github/workflows/base-env.yml @@ -8,7 +8,7 @@ env: jobs: setup: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - name: Print Xcode version run: echo "The selected Xcode version is $XCODE_VERSION" diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 6405dde180..5a5cec9e04 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -8,13 +8,12 @@ jobs: build: uses: ./base-env.yml - env: sonarToken: ${{ secrets.SONAR_TOKEN }} destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" - runs-on: macos-14-xlarge # Apple Silicon Runner + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 @@ -28,7 +27,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: ${XCODE_VERSION} + xcode-version: ${{ env.XCODE_VERSION }} - name: Install Tools run: | From 8d9c2639fdd0970075032d8f0e8cdcbb30689bfd Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 17:21:28 +0100 Subject: [PATCH 45/58] Update PR Scan workflow --- .github/workflows/base-env.yml | 14 -------------- .github/workflows/pr_scan.yml | 3 +-- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 .github/workflows/base-env.yml diff --git a/.github/workflows/base-env.yml b/.github/workflows/base-env.yml deleted file mode 100644 index 2d2daa7982..0000000000 --- a/.github/workflows/base-env.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Base Environment Workflow - -on: - workflow_call: - -env: - XCODE_VERSION: '16.1' # Define the Xcode version here - -jobs: - setup: - runs-on: macos-14-xlarge - steps: - - name: Print Xcode version - run: echo "The selected Xcode version is $XCODE_VERSION" diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 5a5cec9e04..16b0098b1e 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -7,7 +7,6 @@ on: jobs: build: - uses: ./base-env.yml env: sonarToken: ${{ secrets.SONAR_TOKEN }} destination: "name=iPhone 16 Pro,OS=18.1" @@ -27,7 +26,7 @@ jobs: - name: Select latest Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: ${{ env.XCODE_VERSION }} + xcode-version: '16.1' - name: Install Tools run: | From 9ee3a2dadd91239c1585428dc4fee2c033306d53 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 17:22:52 +0100 Subject: [PATCH 46/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 16b0098b1e..ff47ed9de8 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -12,7 +12,7 @@ jobs: destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" - runs-on: macos-14-xlarge + runs-on: macos-14-xlarge # Apple Silicon Runner steps: - uses: actions/checkout@v3 From 014c59be18486a587833df658d5b25001c547e47 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 17:42:50 +0100 Subject: [PATCH 47/58] Update CoderTests --- .../Adyen Tests/Utilities/CoderTests.swift | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift b/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift index 6c3483d326..25e28c9662 100644 --- a/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift +++ b/Tests/AdyenTests/Adyen Tests/Utilities/CoderTests.swift @@ -27,44 +27,31 @@ class CoderTests: XCTestCase { XCTAssertEqual(sampleObject.date.description, "2015-02-28 21:30:00 +0000") XCTAssertEqual(sampleObject.nestedObject.nestedValue, "value") } - - func testEncodeToString() throws { - // Given - let expectedObject = sampleObject - // When - let encodedString = try XCTUnwrap(try? Coder.encode(expectedObject) as String) + func testEncodeToString() throws { + let encodedString = try Coder.encode(sampleObject) as String - // Then - let dataFromString = try XCTUnwrap(encodedString.data(using: .utf8)) - let receivedObject: SampleObject = try XCTUnwrap(try? Coder.decode(dataFromString)) - XCTAssertEqual(expectedObject, receivedObject) + XCTAssertEqual(encodedString, sampleObjectRawString) } - - func testEncodeToData() throws { - // Given - let objectData = try XCTUnwrap(sampleObjectRawString.data(using: .utf8)) - let expectedObject: SampleObject = try XCTUnwrap(try? Coder.decode(objectData)) - // When - let encodedData = try XCTUnwrap(try? Coder.encode(sampleObject) as Data) + func testEncodeToData() throws { + let encodedData = try Coder.encode(sampleObject) as Data + let expectedData = sampleObjectRawString.data(using: .utf8) - // Then - let receivedObject: SampleObject = try XCTUnwrap(try? Coder.decode(encodedData)) - XCTAssertEqual(expectedObject, receivedObject) + XCTAssertEqual(encodedData, expectedData) } // MARK: - Private - private let sampleObjectRawString = "{\"nested\":{\"nestedValue\":\"value\"},\"string\":\"someString\",\"some_integer\":99,\"date\":\"2015-02-28T21:30:00Z\"}" - + private let sampleObjectRawString = "{\"date\":\"2015-02-28T21:30:00Z\",\"nested\":{\"nestedValue\":\"value\"},\"some_integer\":99,\"string\":\"someString\"}" + private lazy var sampleObject: SampleObject = { let nestedObject = NestedObject(nestedValue: "value") let date = Date(timeIntervalSince1970: 1425159000) return SampleObject(string: "someString", integer: 99, date: date, nestedObject: nestedObject) }() - private struct SampleObject: Codable, Equatable { + private struct SampleObject: Codable { var string: String var integer: Int var date: Date @@ -78,7 +65,7 @@ class CoderTests: XCTestCase { } } - private struct NestedObject: Codable, Equatable { + private struct NestedObject: Codable { var nestedValue: String enum CodingKeys: String, CodingKey { From 51ab54fab82e82c778f46cde50bf9e21b00c95bb Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 17:55:09 +0100 Subject: [PATCH 48/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index ff47ed9de8..43bed99798 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -24,9 +24,7 @@ jobs: java-version: '17' - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' + uses: ./select-xcode.yml - name: Install Tools run: | From 6ae6f79b8e684ef83fa5efcf487f7c893289be51 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 17:58:04 +0100 Subject: [PATCH 49/58] Update PR Scan workflow From ea58ccd9510575029050f4b7bbb98309f279098e Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 18:09:56 +0100 Subject: [PATCH 50/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 43bed99798..ff47ed9de8 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -24,7 +24,9 @@ jobs: java-version: '17' - name: Select latest Xcode - uses: ./select-xcode.yml + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.1' - name: Install Tools run: | From 862bffe49329afbb3496ed22e711d6a46c75c9aa Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 18:16:33 +0100 Subject: [PATCH 51/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index ff47ed9de8..0167a86ffb 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -5,6 +5,8 @@ on: types: [opened, synchronize, reopened] jobs: + call-base-workflow: + uses: ./select-xcode.yml build: env: @@ -23,10 +25,10 @@ jobs: with: java-version: '17' - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' + # - name: Select latest Xcode + # uses: maxim-lobanov/setup-xcode@v1 + # with: + # xcode-version: '16.1' - name: Install Tools run: | From 939c29255a24dd5a7cc9577b6b98fd83cd6f30bf Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 20 Jan 2025 18:17:30 +0100 Subject: [PATCH 52/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 0167a86ffb..308ce7bd73 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -5,9 +5,7 @@ on: types: [opened, synchronize, reopened] jobs: - call-base-workflow: - uses: ./select-xcode.yml - + build: env: sonarToken: ${{ secrets.SONAR_TOKEN }} @@ -25,10 +23,10 @@ jobs: with: java-version: '17' - # - name: Select latest Xcode - # uses: maxim-lobanov/setup-xcode@v1 - # with: - # xcode-version: '16.1' + - name: Select latest Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.1' - name: Install Tools run: | From 60f6ae0d43b63aefb6f93cf70e90fe1fc6f64208 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Tue, 21 Jan 2025 11:17:32 +0100 Subject: [PATCH 53/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 308ce7bd73..e3b6b5c3e9 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -12,7 +12,7 @@ jobs: destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" - runs-on: macos-14-xlarge # Apple Silicon Runner + runs-on: macos-latest # Apple Silicon Runner steps: - uses: actions/checkout@v3 From caf5ecfb085ab8c944ff87f2a6ffd95b8f39aca6 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Tue, 21 Jan 2025 11:54:00 +0100 Subject: [PATCH 54/58] Update PR Scan workflow --- .github/workflows/build.yml | 10 +++++----- .github/workflows/format_project.yml | 2 +- .github/workflows/regenerate-docs.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/test-SPM-integration.yml | 2 +- .github/workflows/test-carthage-integration.yml | 2 +- .github/workflows/test_cocoapods_integration.yml | 2 +- .github/workflows/update-version.yml | 2 +- Demo/Common/Configuration/ConfigurationView.swift | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8cec1f8ea..3a1148d719 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: tests: - runs-on: macos-14-xlarge + runs-on: macos-latest continue-on-error: true strategy: fail-fast: false @@ -21,7 +21,7 @@ jobs: runtime: 'iOS-18-1' device: 'iPhone 16' displayname: 'iPhone-16' - os: 'macos-14-xlarge' + os: 'macos-latest' xcode_version: '16.1' needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 @@ -29,7 +29,7 @@ jobs: runtime: 'iOS-18-1' device: 'iPad (10th generation)' displayname: 'iPad-10th-generation' - os: 'macos-14-xlarge' + os: 'macos-latest' xcode_version: '16.1' needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 @@ -37,7 +37,7 @@ jobs: runtime: 'iOS-16-4' device: 'iPhone 14' displayname: 'iPhone-14' - os: 'macos-14-xlarge' + os: 'macos-latest' xcode_version: '16.1' needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 steps: @@ -81,7 +81,7 @@ jobs: destination: ${{ matrix.destination }} sonar: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 diff --git a/.github/workflows/format_project.yml b/.github/workflows/format_project.yml index 43c2b7ae58..5a1d5a0c38 100644 --- a/.github/workflows/format_project.yml +++ b/.github/workflows/format_project.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Update: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/regenerate-docs.yml b/.github/workflows/regenerate-docs.yml index aebc79c3c4..ffbbce04b3 100644 --- a/.github/workflows/regenerate-docs.yml +++ b/.github/workflows/regenerate-docs.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Generate: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 1087ce66db..15ef468395 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -12,7 +12,7 @@ on: jobs: setup: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index c618add167..65631a3533 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -12,7 +12,7 @@ on: jobs: SPM: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 649326843e..7a068066d2 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -12,7 +12,7 @@ on: jobs: carthage: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index 32b0c107b4..bf21efe0dd 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -12,7 +12,7 @@ on: jobs: pods: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index a712962e83..f886c26a50 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -8,7 +8,7 @@ on: jobs: Update: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v3 with: diff --git a/Demo/Common/Configuration/ConfigurationView.swift b/Demo/Common/Configuration/ConfigurationView.swift index 336205b918..fb372383ff 100644 --- a/Demo/Common/Configuration/ConfigurationView.swift +++ b/Demo/Common/Configuration/ConfigurationView.swift @@ -152,10 +152,10 @@ private struct ListItemView: View { }.tag(viewModel.tag) } - fileprivate struct ViewModel { + fileprivate struct ViewModel { let title: String let subtitle: String - let tag: T + let tag: U } } From bdb309f2183d0473086de1baa43e1318ae46737e Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Tue, 21 Jan 2025 12:19:57 +0100 Subject: [PATCH 55/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 9 +++++---- .github/workflows/publich_podspec.yml | 2 +- .github/workflows/publish-demo-app.yml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index e3b6b5c3e9..92df3e3c93 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -13,6 +13,7 @@ jobs: project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" runs-on: macos-latest # Apple Silicon Runner + - uses: ./.github/workflows/select-xcode.yml steps: - uses: actions/checkout@v3 @@ -23,10 +24,10 @@ jobs: with: java-version: '17' - - name: Select latest Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' + # - name: Select latest Xcode + # uses: maxim-lobanov/setup-xcode@v1 + # with: + # xcode-version: '16.1' - name: Install Tools run: | diff --git a/.github/workflows/publich_podspec.yml b/.github/workflows/publich_podspec.yml index b49211eddd..bb9be65ce7 100644 --- a/.github/workflows/publich_podspec.yml +++ b/.github/workflows/publich_podspec.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: publish: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-demo-app.yml b/.github/workflows/publish-demo-app.yml index 1c39030eb6..e7af97f876 100644 --- a/.github/workflows/publish-demo-app.yml +++ b/.github/workflows/publish-demo-app.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Publish: - runs-on: macos-14-xlarge + runs-on: macos-latest steps: - uses: actions/checkout@v3 with: From fafc0d0647d0643d6a884927310c3f82acff5ca1 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Tue, 21 Jan 2025 12:20:48 +0100 Subject: [PATCH 56/58] Update PR Scan workflow --- .github/workflows/pr_scan.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 92df3e3c93..2cbe107fc9 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -12,8 +12,7 @@ jobs: destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" - runs-on: macos-latest # Apple Silicon Runner - - uses: ./.github/workflows/select-xcode.yml + runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -24,10 +23,10 @@ jobs: with: java-version: '17' - # - name: Select latest Xcode - # uses: maxim-lobanov/setup-xcode@v1 - # with: - # xcode-version: '16.1' + - name: Select latest Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.1' - name: Install Tools run: | From 4bc54e47a73410959f9e2fec4c87dda8ea63660a Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Tue, 21 Jan 2025 13:36:05 +0100 Subject: [PATCH 57/58] Update ThreeDS2ClassicActionHandlerTests --- .../ThreeDS2ClassicActionHandlerTests.swift | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift b/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift index 79535b1e9b..04d38a78ac 100644 --- a/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift +++ b/Tests/AdyenTests/Card Tests/3DS2 Component/ThreeDS2ClassicActionHandlerTests.swift @@ -62,7 +62,7 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { let fingerprint = try ThreeDS2Component.Fingerprint( authenticationRequestParameters: authenticationRequestParameters ) - let expectedFingerprintJSON = try Coder.encode(fingerprint) as String + let expectedFingerprint = try Coder.encodeBase64(fingerprint) let resultExpectation = expectation(description: "Expect ThreeDS2ActionHandler completion closure to be called.") let sut = ThreeDS2ClassicActionHandler(apiContext: Dummy.context, service: service) @@ -75,12 +75,7 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { let details = details as! ThreeDS2Details switch details { case let .fingerprint(fingerprint): - if let data = Data(base64Encoded: fingerprint), - let receivedFingerprintJSON = String(data: data, encoding: .utf8) { - XCTAssertTrue(self.compareJSONStrings(expectedFingerprintJSON, receivedFingerprintJSON)) - } else { - XCTFail() - } + XCTAssertEqual(fingerprint, expectedFingerprint) default: XCTFail() } @@ -273,24 +268,4 @@ class ThreeDS2ClassicActionHandlerTests: XCTestCase { waitForExpectations(timeout: 2, handler: nil) } - - // MARK: - Private - - func compareJSONStrings(_ jsonString1: String, _ jsonString2: String) -> Bool { - guard let data1 = jsonString1.data(using: .utf8), - let data2 = jsonString2.data(using: .utf8) else { - print("Invalid data.") - return false - } - - do { - let dict1 = try JSONSerialization.jsonObject(with: data1, options: [.allowFragments]) as? [String: Any] - let dict2 = try JSONSerialization.jsonObject(with: data2, options: [.allowFragments]) as? [String: Any] - - return NSDictionary(dictionary: dict1 ?? [:]).isEqual(to: dict2 ?? [:]) - } catch { - print("Error decoding JSON: \(error)") - return false - } - } } From fa307987900d9e3e5019ce4877005bea3bc4b58c Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Tue, 21 Jan 2025 13:46:39 +0100 Subject: [PATCH 58/58] Update runners --- .github/workflows/build.yml | 10 +++++----- .github/workflows/format_project.yml | 2 +- .github/workflows/pr_scan.yml | 2 +- .github/workflows/publich_podspec.yml | 2 +- .github/workflows/publish-demo-app.yml | 2 +- .github/workflows/regenerate-docs.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/test-SPM-integration.yml | 2 +- .github/workflows/test-carthage-integration.yml | 2 +- .github/workflows/test_cocoapods_integration.yml | 2 +- .github/workflows/update-version.yml | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a1148d719..a8cec1f8ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: tests: - runs-on: macos-latest + runs-on: macos-14-xlarge continue-on-error: true strategy: fail-fast: false @@ -21,7 +21,7 @@ jobs: runtime: 'iOS-18-1' device: 'iPhone 16' displayname: 'iPhone-16' - os: 'macos-latest' + os: 'macos-14-xlarge' xcode_version: '16.1' needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 @@ -29,7 +29,7 @@ jobs: runtime: 'iOS-18-1' device: 'iPad (10th generation)' displayname: 'iPad-10th-generation' - os: 'macos-latest' + os: 'macos-14-xlarge' xcode_version: '16.1' needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 @@ -37,7 +37,7 @@ jobs: runtime: 'iOS-16-4' device: 'iPhone 14' displayname: 'iPhone-14' - os: 'macos-latest' + os: 'macos-14-xlarge' xcode_version: '16.1' needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 16 steps: @@ -81,7 +81,7 @@ jobs: destination: ${{ matrix.destination }} sonar: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 diff --git a/.github/workflows/format_project.yml b/.github/workflows/format_project.yml index 5a1d5a0c38..43c2b7ae58 100644 --- a/.github/workflows/format_project.yml +++ b/.github/workflows/format_project.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Update: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/pr_scan.yml b/.github/workflows/pr_scan.yml index 2cbe107fc9..7cae0cc7a2 100644 --- a/.github/workflows/pr_scan.yml +++ b/.github/workflows/pr_scan.yml @@ -12,7 +12,7 @@ jobs: destination: "name=iPhone 16 Pro,OS=18.1" project: "Adyen.xcodeproj" params: "-derivedDataPath ./DerivedData -skipPackagePluginValidation" - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publich_podspec.yml b/.github/workflows/publich_podspec.yml index bb9be65ce7..b49211eddd 100644 --- a/.github/workflows/publich_podspec.yml +++ b/.github/workflows/publich_podspec.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: publish: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-demo-app.yml b/.github/workflows/publish-demo-app.yml index e7af97f876..1c39030eb6 100644 --- a/.github/workflows/publish-demo-app.yml +++ b/.github/workflows/publish-demo-app.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Publish: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/regenerate-docs.yml b/.github/workflows/regenerate-docs.yml index ffbbce04b3..aebc79c3c4 100644 --- a/.github/workflows/regenerate-docs.yml +++ b/.github/workflows/regenerate-docs.yml @@ -3,7 +3,7 @@ on: [workflow_dispatch] jobs: Generate: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 15ef468395..1087ce66db 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -12,7 +12,7 @@ on: jobs: setup: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-SPM-integration.yml b/.github/workflows/test-SPM-integration.yml index 65631a3533..c618add167 100644 --- a/.github/workflows/test-SPM-integration.yml +++ b/.github/workflows/test-SPM-integration.yml @@ -12,7 +12,7 @@ on: jobs: SPM: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test-carthage-integration.yml b/.github/workflows/test-carthage-integration.yml index 7a068066d2..649326843e 100644 --- a/.github/workflows/test-carthage-integration.yml +++ b/.github/workflows/test-carthage-integration.yml @@ -12,7 +12,7 @@ on: jobs: carthage: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v4 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/test_cocoapods_integration.yml b/.github/workflows/test_cocoapods_integration.yml index bf21efe0dd..32b0c107b4 100644 --- a/.github/workflows/test_cocoapods_integration.yml +++ b/.github/workflows/test_cocoapods_integration.yml @@ -12,7 +12,7 @@ on: jobs: pods: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v4 - uses: n1hility/cancel-previous-runs@v3 diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index f886c26a50..a712962e83 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -8,7 +8,7 @@ on: jobs: Update: - runs-on: macos-latest + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v3 with: