From bd034f8d77dccc3d13a221a3c662e949589aad06 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Wed, 9 Aug 2023 10:21:13 +0200 Subject: [PATCH 1/7] fix build for Xcode 15 --- .../WalletConnectModal/Modal/ModalSheet.swift | 2 +- .../WalletConnectModal/Resources/Color.swift | 22 +++++++++---------- .../WebView/WebViewRequestSubscriber.swift | 6 ++++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Sources/WalletConnectModal/Modal/ModalSheet.swift b/Sources/WalletConnectModal/Modal/ModalSheet.swift index 3abe3146d..64c9bb78d 100644 --- a/Sources/WalletConnectModal/Modal/ModalSheet.swift +++ b/Sources/WalletConnectModal/Modal/ModalSheet.swift @@ -177,7 +177,7 @@ extension ModalSheet { Button { viewModel.onCloseButton() } label: { - Image(.close) + Image(Asset.close) .padding(8) } .buttonStyle(CircuralIconButtonStyle()) diff --git a/Sources/WalletConnectModal/Resources/Color.swift b/Sources/WalletConnectModal/Resources/Color.swift index 00a4fe434..35fa0a860 100644 --- a/Sources/WalletConnectModal/Resources/Color.swift +++ b/Sources/WalletConnectModal/Resources/Color.swift @@ -20,17 +20,17 @@ extension Color { self.init(asset.rawValue, bundle: .module) } - static let foreground1 = Color(.foreground1) - static let foreground2 = Color(.foreground2) - static let foreground3 = Color(.foreground3) - static let foregroundInverse = Color(.foregroundInverse) - static let background1 = Color(.background1) - static let background2 = Color(.background2) - static let background3 = Color(.background3) - static let negative = Color(.negative) - static let thickOverlay = Color(.thickOverlay) - static let thinOverlay = Color(.thinOverlay) - static let accent = Color(.accent) + static let foreground1 = Color(AssetColor.foreground1) + static let foreground2 = Color(AssetColor.foreground2) + static let foreground3 = Color(AssetColor.foreground3) + static let foregroundInverse = Color(AssetColor.foregroundInverse) + static let background1 = Color(AssetColor.background1) + static let background2 = Color(AssetColor.background2) + static let background3 = Color(AssetColor.background3) + static let negative = Color(AssetColor.negative) + static let thickOverlay = Color(AssetColor.thickOverlay) + static let thinOverlay = Color(AssetColor.thinOverlay) + static let accent = Color(AssetColor.accent) } #if canImport(UIKit) diff --git a/Sources/Web3Inbox/WebView/WebViewRequestSubscriber.swift b/Sources/Web3Inbox/WebView/WebViewRequestSubscriber.swift index 7c5307221..8cf66e4fd 100644 --- a/Sources/Web3Inbox/WebView/WebViewRequestSubscriber.swift +++ b/Sources/Web3Inbox/WebView/WebViewRequestSubscriber.swift @@ -48,11 +48,15 @@ final class WebViewRequestSubscriber: NSObject, WKScriptMessageHandler { } extension WebViewRequestSubscriber: WKUIDelegate { - + + #if os(iOS) + @available(iOS 15.0, *) func webView(_ webView: WKWebView, requestMediaCapturePermissionFor origin: WKSecurityOrigin, initiatedByFrame frame: WKFrameInfo, type: WKMediaCaptureType, decisionHandler: @escaping (WKPermissionDecision) -> Void) { decisionHandler(.grant) } + + #endif } extension WebViewRequestSubscriber: WKNavigationDelegate { From bf5843732539eed84f3ef65b88253ee8fb3e5271 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Wed, 9 Aug 2023 10:41:44 +0200 Subject: [PATCH 2/7] Switch to xcbeautify for formatting --- .github/workflows/ci.yml | 9 ++- .github/workflows/self_hosted_ci.yml | 99 ---------------------------- Makefile | 25 ++++++- run_tests.sh | 4 +- 4 files changed, 31 insertions(+), 106 deletions(-) delete mode 100644 .github/workflows/self_hosted_ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5df93936..3bf03bac4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: branches: - develop - main + push: + branches: + - fix/ci/formatter concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.ref_name }} @@ -22,7 +25,7 @@ jobs: prepare: needs: authorize - runs-on: macos-12 + runs-on: self-hosted steps: - uses: actions/checkout@v3 with: @@ -35,7 +38,7 @@ jobs: test: needs: prepare - runs-on: macos-12 + runs-on: self-hosted timeout-minutes: 15 strategy: fail-fast: false @@ -93,4 +96,4 @@ jobs: with: name: ${{ matrix.type }} test_results path: ./artifacts.zip - if-no-files-found: warn \ No newline at end of file + if-no-files-found: warn diff --git a/.github/workflows/self_hosted_ci.yml b/.github/workflows/self_hosted_ci.yml deleted file mode 100644 index 11ef877bc..000000000 --- a/.github/workflows/self_hosted_ci.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: self_hosted_ci - -on: - pull_request_target: - branches: - - develop - - main - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.ref_name }} - cancel-in-progress: ${{ github.event_name == 'pull_request_target' }} - -jobs: - authorize: - environment: - ${{ (github.event_name == 'pull_request_target' && - github.event.pull_request.head.repo.full_name != github.repository) && - 'external' || 'internal' }} - runs-on: ubuntu-latest - steps: - - run: echo ✓ - - prepare: - needs: authorize - runs-on: - group: apple-silicon - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - uses: ./.github/actions/build - with: - project-id: ${{ secrets.PROJECT_ID }} - cache-key: self_hosted_ci - - test: - needs: prepare - runs-on: - group: apple-silicon - timeout-minutes: 15 - strategy: - fail-fast: false - matrix: - type: [integration-tests, relay-tests, unit-tests] - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - uses: actions/cache/restore@v3 - with: - path: | - products.tar - key: ${{ runner.os }}-deriveddata-self_hosted_ci-${{ github.event.pull_request.head.sha }} - - - name: Untar DerivedDataCache - shell: bash - run: test -f products.tar && tar xPpf products.tar || echo "No artifacts to untar" - - # Package Unit tests - - name: Run tests - if: matrix.type == 'unit-tests' - shell: bash - run: make unit_tests - - # Integration tests - - name: Run integration tests - if: matrix.type == 'integration-tests' - shell: bash - run: make integration_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }} CAST_HOST=cast.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }} GM_DAPP_PROJECT_SECRET=${{ secrets.GM_DAPP_PROJECT_SECRET }} - - # Relay Integration tests - - name: Run Relay integration tests - if: matrix.type == 'relay-tests' - shell: bash - run: make relay_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }} - - - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 - if: success() || failure() - with: - check_name: ${{ matrix.type }} self-hosted junit report - report_paths: 'test_results/report.junit' - - - name: Zip test artifacts - if: always() - shell: bash - run: test -d "test_results" && zip artifacts.zip -r ./test_results || echo "Nothing to zip" - - - name: Upload test artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.type }} test_results - path: ./artifacts.zip - if-no-files-found: warn diff --git a/Makefile b/Makefile index b25bf256d..f956d89b0 100755 --- a/Makefile +++ b/Makefile @@ -17,8 +17,29 @@ endif @echo "All dependencies was installed" build_all: - set -o pipefail && xcodebuild -scheme "WalletConnect-Package" -destination "platform=iOS Simulator,name=iPhone 11" -derivedDataPath DerivedDataCache -clonedSourcePackagesDirPath ../SourcePackagesCache RELAY_HOST='$(RELAY_HOST)' PROJECT_ID='$(PROJECT_ID)' build-for-testing | xcpretty - set -o pipefail && xcodebuild -project "Example/ExampleApp.xcodeproj" -scheme "BuildAll" -destination "platform=iOS Simulator,name=iPhone 11" -derivedDataPath DerivedDataCache -clonedSourcePackagesDirPath ../SourcePackagesCache RELAY_HOST='$(RELAY_HOST)' PROJECT_ID='$(PROJECT_ID)' CAST_HOST='$(CAST_HOST)' build-for-testing | xcpretty + set -o pipefail && env NSUnbufferedIO=YES \ + xcodebuild \ + -scheme "WalletConnect-Package" \ + -destination "platform=iOS Simulator,name=iPhone 14" \ + -derivedDataPath DerivedDataCache \ + -clonedSourcePackagesDirPath ../SourcePackagesCache \ + RELAY_HOST='$(RELAY_HOST)' \ + PROJECT_ID='$(PROJECT_ID)' \ + build-for-testing \ + | xcbeautify --renderer github-actions + + set -o pipefail && env NSUnbufferedIO=YES \ + xcodebuild \ + -project "Example/ExampleApp.xcodeproj" \ + -scheme "BuildAll" \ + -destination "platform=iOS Simulator,name=iPhone 14" \ + -derivedDataPath DerivedDataCache \ + -clonedSourcePackagesDirPath ../SourcePackagesCache \ + RELAY_HOST='$(RELAY_HOST)' \ + PROJECT_ID='$(PROJECT_ID)' \ + CAST_HOST='$(CAST_HOST)' \ + build-for-testing \ + | xcbeautify --renderer github-actions echo_ui_tests: echo "EchoUITests disabled" diff --git a/run_tests.sh b/run_tests.sh index 52dbe6002..d1b8f34fb 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -74,7 +74,7 @@ if [ -z "$XCTESTRUN" ]; then -resultBundlePath "test_results/$SCHEME.xcresult" \ test \ | tee ./test_results/xcodebuild.log \ - | xcpretty --report junit --output ./test_results/report.junit + | xcbeautify --renderer github-actions --report junit --junit-report-filename report.junit --report-path ./test_results ) else @@ -98,7 +98,7 @@ else -resultBundlePath "test_results/$SCHEME.xcresult" \ test-without-building \ | tee ./test_results/xcodebuild.log \ - | xcpretty --report junit --output ./test_results/report.junit + | xcbeautify --renderer github-actions --report junit --junit-report-filename report.junit --report-path ./test_results ) fi From ce694ea2ef2565c085ef24b9006ab072e8a954c7 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Wed, 9 Aug 2023 11:00:07 +0200 Subject: [PATCH 3/7] Try turning off parallelization --- Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan | 6 ++++-- NotifyTests.xctestplan | 6 +++++- run_tests.sh | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan index 64d647c69..b8bbcc62e 100644 --- a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan +++ b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan @@ -32,15 +32,17 @@ "value" : "$(PROJECT_ID)" } ], + "mainThreadCheckerEnabled" : false, + "maximumTestRepetitions" : 2, "targetForVariableExpansion" : { "containerPath" : "container:ExampleApp.xcodeproj", "identifier" : "A5E03DEC286464DB00888481", "name" : "IntegrationTests" - } + }, + "testRepetitionMode" : "retryOnFailure" }, "testTargets" : [ { - "parallelizable" : true, "skippedTests" : [ "AuthTests\/testEIP1271RespondSuccess()", "ChatTests", diff --git a/NotifyTests.xctestplan b/NotifyTests.xctestplan index 68ef8125e..07e2887b5 100644 --- a/NotifyTests.xctestplan +++ b/NotifyTests.xctestplan @@ -9,6 +9,7 @@ } ], "defaultOptions" : { + "codeCoverage" : false, "environmentVariableEntries" : [ { "key" : "RELAY_HOST", @@ -31,11 +32,14 @@ "value" : "$(PROJECT_ID)" } ], + "mainThreadCheckerEnabled" : false, + "maximumTestRepetitions" : 2, "targetForVariableExpansion" : { "containerPath" : "container:ExampleApp.xcodeproj", "identifier" : "A5E03DEC286464DB00888481", "name" : "IntegrationTests" - } + }, + "testRepetitionMode" : "retryOnFailure" }, "testTargets" : [ { diff --git a/run_tests.sh b/run_tests.sh index d1b8f34fb..74a754df1 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -74,7 +74,7 @@ if [ -z "$XCTESTRUN" ]; then -resultBundlePath "test_results/$SCHEME.xcresult" \ test \ | tee ./test_results/xcodebuild.log \ - | xcbeautify --renderer github-actions --report junit --junit-report-filename report.junit --report-path ./test_results + | xcbeautify --report junit --junit-report-filename report.junit --report-path ./test_results ) else @@ -98,7 +98,7 @@ else -resultBundlePath "test_results/$SCHEME.xcresult" \ test-without-building \ | tee ./test_results/xcodebuild.log \ - | xcbeautify --renderer github-actions --report junit --junit-report-filename report.junit --report-path ./test_results + | xcbeautify --report junit --junit-report-filename report.junit --report-path ./test_results ) fi From 1fd4586b70c837f0f6411f931131b236717ce164 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Wed, 9 Aug 2023 15:39:46 +0200 Subject: [PATCH 4/7] Remove testing push trigger --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bf03bac4..fd2bdd226 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,6 @@ on: branches: - develop - main - push: - branches: - - fix/ci/formatter concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.ref_name }} From 41dfc579971891b48d64501c19b33658ef20d2d0 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Thu, 10 Aug 2023 13:56:59 +0200 Subject: [PATCH 5/7] Revert changes to testplans --- Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan | 6 ++---- NotifyTests.xctestplan | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan index b8bbcc62e..64d647c69 100644 --- a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan +++ b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan @@ -32,17 +32,15 @@ "value" : "$(PROJECT_ID)" } ], - "mainThreadCheckerEnabled" : false, - "maximumTestRepetitions" : 2, "targetForVariableExpansion" : { "containerPath" : "container:ExampleApp.xcodeproj", "identifier" : "A5E03DEC286464DB00888481", "name" : "IntegrationTests" - }, - "testRepetitionMode" : "retryOnFailure" + } }, "testTargets" : [ { + "parallelizable" : true, "skippedTests" : [ "AuthTests\/testEIP1271RespondSuccess()", "ChatTests", diff --git a/NotifyTests.xctestplan b/NotifyTests.xctestplan index 07e2887b5..fc50c4a84 100644 --- a/NotifyTests.xctestplan +++ b/NotifyTests.xctestplan @@ -32,14 +32,11 @@ "value" : "$(PROJECT_ID)" } ], - "mainThreadCheckerEnabled" : false, - "maximumTestRepetitions" : 2, "targetForVariableExpansion" : { "containerPath" : "container:ExampleApp.xcodeproj", "identifier" : "A5E03DEC286464DB00888481", "name" : "IntegrationTests" - }, - "testRepetitionMode" : "retryOnFailure" + } }, "testTargets" : [ { From ff5e4900cba6d7609b6bf7e26374f25acdaa0b7f Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Thu, 10 Aug 2023 13:59:30 +0200 Subject: [PATCH 6/7] correct runner group --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd2bdd226..53ef8af85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,8 @@ jobs: prepare: needs: authorize - runs-on: self-hosted + runs-on: + group: apple-silicon steps: - uses: actions/checkout@v3 with: @@ -35,7 +36,8 @@ jobs: test: needs: prepare - runs-on: self-hosted + runs-on: + group: apple-silicon timeout-minutes: 15 strategy: fail-fast: false From 859680b2354454c581f120a1d54198defa0a6cf8 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Thu, 10 Aug 2023 14:01:11 +0200 Subject: [PATCH 7/7] use default xcbeautify renderer --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f956d89b0..c6fda0599 100755 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ build_all: RELAY_HOST='$(RELAY_HOST)' \ PROJECT_ID='$(PROJECT_ID)' \ build-for-testing \ - | xcbeautify --renderer github-actions + | xcbeautify set -o pipefail && env NSUnbufferedIO=YES \ xcodebuild \ @@ -39,7 +39,7 @@ build_all: PROJECT_ID='$(PROJECT_ID)' \ CAST_HOST='$(CAST_HOST)' \ build-for-testing \ - | xcbeautify --renderer github-actions + | xcbeautify echo_ui_tests: echo "EchoUITests disabled"