From de35fdcf85116a92eb5da4c6cba9239bfaf24843 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Thu, 28 Dec 2023 18:49:48 +0100 Subject: [PATCH 01/10] Add danger --- .github/workflows/ci.yml | 5 + .gitignore | 2 + Dangerfile | 5 + Gemfile | 4 + Gemfile.lock | 263 +++++++++++++++++++++++++++++++++++++++ Package.resolved | 13 +- run_tests.sh | 2 + 7 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 Dangerfile create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a03dc8..f9561d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,11 @@ jobs: shell: bash run: make unit_tests + - name: danger + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bundle exec danger --verbose + - name: Publish Test Report uses: mikepenz/action-junit-report@v3 if: success() || failure() diff --git a/.gitignore b/.gitignore index 6b3878a..45312e1 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,5 @@ DerivedDataCache/ test_results/ Sample/Example/Secrets/secrets.json + +fastlane/xcov_report/ diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 0000000..2225ed8 --- /dev/null +++ b/Dangerfile @@ -0,0 +1,5 @@ +xcov.report( + scheme: 'swift-web3modal-Package', + project: 'Sample/Example.xcodeproj', + minimum_coverage_percentage: 20 +) diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..d7a80e5 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gem "xcov", "~> 1.8" +gem "danger", "~> 9.4" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..dc12b8c --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,263 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.6) + rexml + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + artifactory (3.0.15) + atomos (0.1.3) + aws-eventstream (1.3.0) + aws-partitions (1.875.0) + aws-sdk-core (3.190.1) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.8) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.75.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.142.0) + aws-sdk-core (~> 3, >= 3.189.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + claide (1.1.0) + claide-plugins (0.9.2) + cork + nap + open4 (~> 1.3) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + cork (0.3.0) + colored2 (~> 3.1) + danger (9.4.2) + claide (~> 1.0) + claide-plugins (>= 0.9.2) + colored2 (~> 3.1) + cork (~> 0.1) + faraday (>= 0.9.0, < 3.0) + faraday-http-cache (~> 2.0) + git (~> 1.13) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.0) + no_proxy_fix + octokit (>= 4.0) + terminal-table (>= 1, < 4) + declarative (0.0.20) + digest-crc (0.6.5) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20231109) + dotenv (2.8.1) + emoji_regex (3.2.3) + excon (0.108.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-http-cache (2.5.0) + faraday (>= 0.8) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.3.0) + fastlane (2.217.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (>= 2.0.0, < 3.0.0) + naturally (~> 2.2) + optparse (~> 0.1.1) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (~> 3) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + gh_inspector (1.1.3) + git (1.18.0) + addressable (~> 2.8) + rchardet (~> 1.8) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.2) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.29.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.6.1) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (2.1.0) + faraday (>= 1.0, < 3.a) + google-cloud-errors (1.3.1) + google-cloud-storage (1.45.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.29.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.9.1) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.1) + jwt (>= 1.4, < 3.0) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.5) + domain_name (~> 0.5) + httpclient (2.8.3) + jmespath (1.6.2) + json (2.7.1) + jwt (2.7.1) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + mini_magick (4.12.0) + mini_mime (1.1.5) + multi_json (1.15.0) + multipart-post (2.3.0) + nanaimo (0.3.0) + nap (1.1.0) + naturally (2.2.1) + no_proxy_fix (0.1.2) + octokit (8.0.0) + faraday (>= 1, < 3) + sawyer (~> 0.9) + open4 (1.3.4) + optparse (0.1.1) + os (1.1.4) + plist (3.7.1) + public_suffix (5.0.4) + rake (13.1.0) + rchardet (1.8.0) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.2.6) + rouge (2.0.7) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + security (0.1.3) + signet (0.18.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.10) + CFPropertyList + naturally + slack-notifier (2.4.0) + terminal-notifier (2.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unicode-display_width (2.5.0) + webrick (1.8.1) + word_wrap (1.0.0) + xcodeproj (1.23.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + xcov (1.8.1) + fastlane (>= 2.141.0, < 3.0.0) + multipart-post + slack-notifier + terminal-table + xcodeproj + xcresult (~> 0.2.0) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + xcresult (0.2.1) + +PLATFORMS + arm64-darwin-22 + ruby + +DEPENDENCIES + danger (~> 9.4) + xcov (~> 1.8) + +BUNDLED WITH + 2.5.1 diff --git a/Package.resolved b/Package.resolved index 28f681c..80ed09a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -36,13 +36,22 @@ "version" : "1.1.6" } }, + { + "identity" : "wallet-mobile-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/coinbase/wallet-mobile-sdk.git", + "state" : { + "revision" : "4aa89e682f8d7ab1515d85d0797f0d25306bb56a", + "version" : "1.0.5" + } + }, { "identity" : "walletconnectswiftv2", "kind" : "remoteSourceControl", "location" : "https://github.com/WalletConnect/WalletConnectSwiftV2", "state" : { - "revision" : "4aa4c8229077c133730e361d0d7a17f9e56bdffd", - "version" : "1.9.6" + "revision" : "031c61bfbd4c4eed4a5cb6790152ce736a4f1fba", + "version" : "1.10.0" } } ], diff --git a/run_tests.sh b/run_tests.sh index e00c9da..231fc8c 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -52,6 +52,7 @@ if [ -z "$XCTESTRUN" ]; then -derivedDataPath DerivedDataCache \ -clonedSourcePackagesDirPath ../SourcePackagesCache \ -resultBundlePath "test_results/$SCHEME.xcresult" \ + -enableCodeCoverage YES \ test \ | tee ./test_results/xcodebuild.log \ | xcbeautify --report junit --junit-report-filename report.junit --report-path ./test_results @@ -72,6 +73,7 @@ else -derivedDataPath DerivedDataCache \ -clonedSourcePackagesDirPath ../SourcePackagesCache \ -resultBundlePath "test_results/$SCHEME.xcresult" \ + -enableCodeCoverage YES \ test-without-building \ | tee ./test_results/xcodebuild.log \ | xcbeautify --report junit --junit-report-filename report.junit --report-path ./test_results From 264d830644c615e72ae9d08f21b847eaa39878be Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Thu, 28 Dec 2023 18:54:04 +0100 Subject: [PATCH 02/10] change event --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9561d0..ed6ab29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: ci on: - pull_request_target: + pull_request: branches: - develop - main From 064cf9ad2076351519a8186972b5df1ace8d8476 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Thu, 28 Dec 2023 19:19:48 +0100 Subject: [PATCH 03/10] Use correct ruby version --- .github/workflows/ci.yml | 6 ++++-- Dangerfile | 2 +- Gemfile | 1 + Gemfile.lock | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed6ab29..64c4a22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,10 +41,12 @@ jobs: shell: bash run: make unit_tests - - name: danger + - name: Danger env: DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bundle exec danger --verbose + run: + /opt/homebrew/opt/ruby/bin/bundle install | + /opt/homebrew/opt/ruby/bin/bundle exec danger --verbose - name: Publish Test Report uses: mikepenz/action-junit-report@v3 diff --git a/Dangerfile b/Dangerfile index 2225ed8..473f546 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,5 +1,5 @@ xcov.report( scheme: 'swift-web3modal-Package', project: 'Sample/Example.xcodeproj', - minimum_coverage_percentage: 20 + minimum_coverage_percentage: 0.20 ) diff --git a/Gemfile b/Gemfile index d7a80e5..e0e71fe 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,4 @@ source "https://rubygems.org" gem "xcov", "~> 1.8" gem "danger", "~> 9.4" +gem "danger-xcov", "~> 0.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index dc12b8c..0d41fe5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,6 +48,9 @@ GEM no_proxy_fix octokit (>= 4.0) terminal-table (>= 1, < 4) + danger-xcov (0.5.0) + danger (>= 2.1) + xcov (>= 1.7.3) declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) @@ -257,6 +260,7 @@ PLATFORMS DEPENDENCIES danger (~> 9.4) + danger-xcov (~> 0.5.0) xcov (~> 1.8) BUNDLED WITH From d894731d7075c905ce1f4ca13ff876a6194eaf4f Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Sat, 30 Dec 2023 23:25:23 +0100 Subject: [PATCH 04/10] Point to .xcresult --- .gitignore | 2 + Package.resolved | 9 --- Sample/Example.xcodeproj/project.pbxproj | 24 ++++++- .../contents.xcworkspacedata | 13 ++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++ .../xcshareddata/swiftpm/Package.resolved | 68 +++++++++++++++++++ .../swift-web3modal-Package.xcscheme | 0 7 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 Web3Modal.xcworkspace/contents.xcworkspacedata create mode 100644 Web3Modal.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Web3Modal.xcworkspace/xcshareddata/swiftpm/Package.resolved rename {.swiftpm/xcode => Web3Modal.xcworkspace}/xcshareddata/xcschemes/swift-web3modal-Package.xcscheme (100%) diff --git a/.gitignore b/.gitignore index 45312e1..91bf9ac 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,5 @@ test_results/ Sample/Example/Secrets/secrets.json fastlane/xcov_report/ + +xcov_report/ diff --git a/Package.resolved b/Package.resolved index 80ed09a..d17d9c6 100644 --- a/Package.resolved +++ b/Package.resolved @@ -36,15 +36,6 @@ "version" : "1.1.6" } }, - { - "identity" : "wallet-mobile-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/coinbase/wallet-mobile-sdk.git", - "state" : { - "revision" : "4aa89e682f8d7ab1515d85d0797f0d25306bb56a", - "version" : "1.0.5" - } - }, { "identity" : "walletconnectswiftv2", "kind" : "remoteSourceControl", diff --git a/Sample/Example.xcodeproj/project.pbxproj b/Sample/Example.xcodeproj/project.pbxproj index 3347519..3a4108e 100644 --- a/Sample/Example.xcodeproj/project.pbxproj +++ b/Sample/Example.xcodeproj/project.pbxproj @@ -3,11 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ CF0BCCE52AB0886400A2866C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF0BCCE42AB0886400A2866C /* ContentView.swift */; }; + CF25F3A22B40C7070030B3DC /* Web3Modal in Frameworks */ = {isa = PBXBuildFile; productRef = CF25F3A12B40C7070030B3DC /* Web3Modal */; }; + CF25F3A42B40C7070030B3DC /* Web3ModalUI in Frameworks */ = {isa = PBXBuildFile; productRef = CF25F3A32B40C7070030B3DC /* Web3ModalUI */; }; CF3B9AD02ACDBA3A00984D53 /* Web3Modal in Frameworks */ = {isa = PBXBuildFile; productRef = CF3B9ACF2ACDBA3A00984D53 /* Web3Modal */; }; CF3B9AD22ACDBA3A00984D53 /* Web3ModalUI in Frameworks */ = {isa = PBXBuildFile; productRef = CF3B9AD12ACDBA3A00984D53 /* Web3ModalUI */; }; CFA99B922AD0549F00EB5331 /* WCSocketFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFA99B912AD0549F00EB5331 /* WCSocketFactory.swift */; }; @@ -44,7 +46,9 @@ files = ( CF3B9AD02ACDBA3A00984D53 /* Web3Modal in Frameworks */, CFD6A70F2ADE8DE2002B402C /* Atlantis in Frameworks */, + CF25F3A42B40C7070030B3DC /* Web3ModalUI in Frameworks */, CF3B9AD22ACDBA3A00984D53 /* Web3ModalUI in Frameworks */, + CF25F3A22B40C7070030B3DC /* Web3Modal in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -130,6 +134,8 @@ CF3B9ACF2ACDBA3A00984D53 /* Web3Modal */, CF3B9AD12ACDBA3A00984D53 /* Web3ModalUI */, CFD6A70E2ADE8DE2002B402C /* Atlantis */, + CF25F3A12B40C7070030B3DC /* Web3Modal */, + CF25F3A32B40C7070030B3DC /* Web3ModalUI */, ); productName = Example; productReference = CFD720742A9CC60600636CAF /* Example.app */; @@ -161,6 +167,7 @@ mainGroup = CFD7206B2A9CC60600636CAF; packageReferences = ( CFD6A70D2ADE8DE2002B402C /* XCRemoteSwiftPackageReference "atlantis" */, + CF25F3A02B40C7070030B3DC /* XCLocalSwiftPackageReference ".." */, ); productRefGroup = CFD720752A9CC60600636CAF /* Products */; projectDirPath = ""; @@ -426,6 +433,13 @@ }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + CF25F3A02B40C7070030B3DC /* XCLocalSwiftPackageReference ".." */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ..; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCRemoteSwiftPackageReference section */ CFD6A70D2ADE8DE2002B402C /* XCRemoteSwiftPackageReference "atlantis" */ = { isa = XCRemoteSwiftPackageReference; @@ -438,6 +452,14 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + CF25F3A12B40C7070030B3DC /* Web3Modal */ = { + isa = XCSwiftPackageProductDependency; + productName = Web3Modal; + }; + CF25F3A32B40C7070030B3DC /* Web3ModalUI */ = { + isa = XCSwiftPackageProductDependency; + productName = Web3ModalUI; + }; CF3B9ACF2ACDBA3A00984D53 /* Web3Modal */ = { isa = XCSwiftPackageProductDependency; productName = Web3Modal; diff --git a/Web3Modal.xcworkspace/contents.xcworkspacedata b/Web3Modal.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..194b216 --- /dev/null +++ b/Web3Modal.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/Web3Modal.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Web3Modal.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Web3Modal.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Web3Modal.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Web3Modal.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..1f71004 --- /dev/null +++ b/Web3Modal.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,68 @@ +{ + "pins" : [ + { + "identity" : "atlantis", + "kind" : "remoteSourceControl", + "location" : "https://github.com/ProxymanApp/atlantis", + "state" : { + "revision" : "131d757cf8e6e368ad338728379174f7cfff9326", + "version" : "1.23.0" + } + }, + { + "identity" : "qrcode", + "kind" : "remoteSourceControl", + "location" : "https://github.com/WalletConnect/QRCode", + "state" : { + "revision" : "263f280d2c8144adfb0b6676109846cfc8dd552b", + "version" : "14.3.1" + } + }, + { + "identity" : "swift-qrcode-generator", + "kind" : "remoteSourceControl", + "location" : "https://github.com/dagronf/swift-qrcode-generator", + "state" : { + "revision" : "5ca09b6a2ad190f94aa3d6ddef45b187f8c0343b", + "version" : "1.0.3" + } + }, + { + "identity" : "swift-snapshot-testing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-snapshot-testing", + "state" : { + "revision" : "59b663f68e69f27a87b45de48cb63264b8194605", + "version" : "1.15.1" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-syntax.git", + "state" : { + "revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", + "version" : "509.0.2" + } + }, + { + "identity" : "swiftimagereadwrite", + "kind" : "remoteSourceControl", + "location" : "https://github.com/dagronf/SwiftImageReadWrite", + "state" : { + "revision" : "5596407d1cf61b953b8e658fa8636a471df3c509", + "version" : "1.1.6" + } + }, + { + "identity" : "walletconnectswiftv2", + "kind" : "remoteSourceControl", + "location" : "https://github.com/WalletConnect/WalletConnectSwiftV2", + "state" : { + "revision" : "031c61bfbd4c4eed4a5cb6790152ce736a4f1fba", + "version" : "1.10.0" + } + } + ], + "version" : 2 +} diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/swift-web3modal-Package.xcscheme b/Web3Modal.xcworkspace/xcshareddata/xcschemes/swift-web3modal-Package.xcscheme similarity index 100% rename from .swiftpm/xcode/xcshareddata/xcschemes/swift-web3modal-Package.xcscheme rename to Web3Modal.xcworkspace/xcshareddata/xcschemes/swift-web3modal-Package.xcscheme From b3cb07c718aede2f3ee58546575f3909cb56955b Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Sat, 30 Dec 2023 23:36:11 +0100 Subject: [PATCH 05/10] Cleanup --- Web3Modal.xcworkspace/contents.xcworkspacedata | 3 --- 1 file changed, 3 deletions(-) diff --git a/Web3Modal.xcworkspace/contents.xcworkspacedata b/Web3Modal.xcworkspace/contents.xcworkspacedata index 194b216..572e1a8 100644 --- a/Web3Modal.xcworkspace/contents.xcworkspacedata +++ b/Web3Modal.xcworkspace/contents.xcworkspacedata @@ -7,7 +7,4 @@ - - From c6b4d6768b2b5e34c47a956ffd4a3e437f703225 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Sun, 31 Dec 2023 00:04:04 +0100 Subject: [PATCH 06/10] Try updated xcov plugin --- Gemfile | 2 +- Gemfile.lock | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index e0e71fe..bd341ea 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "xcov", "~> 1.8" gem "danger", "~> 9.4" -gem "danger-xcov", "~> 0.5.0" +gem "danger-xcov", git: 'https://github.com/getyourguide/danger-xcov.git' diff --git a/Gemfile.lock b/Gemfile.lock index 0d41fe5..00c5bff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,11 @@ +GIT + remote: https://github.com/getyourguide/danger-xcov.git + revision: 10cc78b6dcbf949e460625cc9a68b5e1b786d115 + specs: + danger-xcov (0.5.0) + danger (>= 2.1) + xcov (>= 1.8.0) + GEM remote: https://rubygems.org/ specs: @@ -8,7 +16,7 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.875.0) + aws-partitions (1.876.0) aws-sdk-core (3.190.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) @@ -48,9 +56,6 @@ GEM no_proxy_fix octokit (>= 4.0) terminal-table (>= 1, < 4) - danger-xcov (0.5.0) - danger (>= 2.1) - xcov (>= 1.7.3) declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) @@ -130,7 +135,7 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) gh_inspector (1.1.3) - git (1.18.0) + git (1.19.0) addressable (~> 2.8) rchardet (~> 1.8) google-apis-androidpublisher_v3 (0.54.0) @@ -260,7 +265,7 @@ PLATFORMS DEPENDENCIES danger (~> 9.4) - danger-xcov (~> 0.5.0) + danger-xcov! xcov (~> 1.8) BUNDLED WITH From 769799082c76352d7b1867210849ade5090e38b3 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Sun, 31 Dec 2023 00:11:36 +0100 Subject: [PATCH 07/10] Point to xcresult --- Dangerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dangerfile b/Dangerfile index 473f546..750efea 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,5 +1,5 @@ xcov.report( scheme: 'swift-web3modal-Package', - project: 'Sample/Example.xcodeproj', - minimum_coverage_percentage: 0.20 + minimum_coverage_percentage: 20.0, + xccov_file_direct_path: 'test_results/swift-web3modal-Package.xcresult' ) From f5a913e72302fafda3536d581cd68293ad573925 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Sun, 31 Dec 2023 15:50:24 +0100 Subject: [PATCH 08/10] Clean any previous reports, try adding uncovered code --- .github/workflows/ci.yml | 3 ++- Dangerfile | 3 ++- Sources/Web3Modal/Core/Web3Modal.swift | 10 ++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64c4a22..7b683ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,8 +45,9 @@ jobs: env: DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: + rm -rf xcov_report | /opt/homebrew/opt/ruby/bin/bundle install | - /opt/homebrew/opt/ruby/bin/bundle exec danger --verbose + /opt/homebrew/opt/ruby/bin/bundle exec danger - name: Publish Test Report uses: mikepenz/action-junit-report@v3 diff --git a/Dangerfile b/Dangerfile index 750efea..94fb9c0 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,5 +1,6 @@ xcov.report( scheme: 'swift-web3modal-Package', minimum_coverage_percentage: 20.0, - xccov_file_direct_path: 'test_results/swift-web3modal-Package.xcresult' + xccov_file_direct_path: 'test_results/swift-web3modal-Package.xcresult', + include_targets: 'Web3Modal,Web3ModalUI', ) diff --git a/Sources/Web3Modal/Core/Web3Modal.swift b/Sources/Web3Modal/Core/Web3Modal.swift index cd3133b..6b6c721 100644 --- a/Sources/Web3Modal/Core/Web3Modal.swift +++ b/Sources/Web3Modal/Core/Web3Modal.swift @@ -126,6 +126,16 @@ public class Web3Modal { public static func set(sessionParams: SessionParams) { Web3Modal.config.sessionParams = sessionParams } + + public func uncoveredFunc() { + print("uncoveredFunc") + + if Int.random(in: 1...5) == 2 { + print("randomBranch") + } else { + print("randomBranch") + } + } } #if canImport(UIKit) From 0ece9f6ffa57f7f94787faaad5a829fbdb43d616 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Tue, 2 Jan 2024 11:42:27 +0100 Subject: [PATCH 09/10] Remove test function --- .github/workflows/ci.yml | 2 +- Sources/Web3Modal/Core/Web3Modal.swift | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b683ad..ed7e814 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: ci on: - pull_request: + pull_request_target: branches: - develop - main diff --git a/Sources/Web3Modal/Core/Web3Modal.swift b/Sources/Web3Modal/Core/Web3Modal.swift index 6b6c721..cd3133b 100644 --- a/Sources/Web3Modal/Core/Web3Modal.swift +++ b/Sources/Web3Modal/Core/Web3Modal.swift @@ -126,16 +126,6 @@ public class Web3Modal { public static func set(sessionParams: SessionParams) { Web3Modal.config.sessionParams = sessionParams } - - public func uncoveredFunc() { - print("uncoveredFunc") - - if Int.random(in: 1...5) == 2 { - print("randomBranch") - } else { - print("randomBranch") - } - } } #if canImport(UIKit) From de04a6e3c98ca4661152981bc638b9f118a6c320 Mon Sep 17 00:00:00 2001 From: Radek Novak Date: Tue, 2 Jan 2024 11:44:56 +0100 Subject: [PATCH 10/10] Switch to plain `pull_request` trigger --- .github/workflows/ci.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed7e814..ca6fbf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,27 +1,17 @@ name: ci on: - pull_request_target: + pull_request: branches: - develop - main 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' }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} 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 ✓ - test: - needs: authorize runs-on: group: apple-silicon timeout-minutes: 15