diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c168ac568..8c4822fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,8 @@ jobs: prepare: needs: authorize - runs-on: macos-12 + runs-on: + group: apple-silicon steps: - uses: actions/checkout@v3 with: @@ -35,7 +36,8 @@ jobs: test: needs: prepare - runs-on: macos-12 + runs-on: + group: apple-silicon timeout-minutes: 15 strategy: fail-fast: false diff --git a/.github/workflows/self_hosted_ci.yml b/.github/workflows/self_hosted_ci.yml deleted file mode 100644 index 71d63246a..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 }} JS_CLIENT_API_HOST=test-automation-api.walletconnect.com - - # 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 caaa37f36..6d054315d 100755 --- a/Makefile +++ b/Makefile @@ -17,8 +17,30 @@ 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)' JS_CLIENT_API_HOST='$(JS_CLIENT_API_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 + + 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)' \ + JS_CLIENT_API_HOST='$(JS_CLIENT_API_HOST)' \ + build-for-testing \ + | xcbeautify echo_ui_tests: echo "EchoUITests disabled" diff --git a/NotifyTests.xctestplan b/NotifyTests.xctestplan index 68ef8125e..fc50c4a84 100644 --- a/NotifyTests.xctestplan +++ b/NotifyTests.xctestplan @@ -9,6 +9,7 @@ } ], "defaultOptions" : { + "codeCoverage" : false, "environmentVariableEntries" : [ { "key" : "RELAY_HOST", 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 { diff --git a/run_tests.sh b/run_tests.sh index db83e4218..eb906df0e 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 --report junit --junit-report-filename report.junit --report-path ./test_results ) else @@ -99,7 +99,7 @@ else -resultBundlePath "test_results/$SCHEME.xcresult" \ test-without-building \ | tee ./test_results/xcodebuild.log \ - | xcpretty --report junit --output ./test_results/report.junit + | xcbeautify --report junit --junit-report-filename report.junit --report-path ./test_results ) fi