From 6733e8365cf50c56a3ea47f4b821885e087823ee Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Tue, 19 Jul 2022 16:39:32 +0200 Subject: [PATCH 1/3] update session namespace on response only --- .../Engine/Controller/ControllerSessionStateMachine.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/WalletConnectSign/Engine/Controller/ControllerSessionStateMachine.swift b/Sources/WalletConnectSign/Engine/Controller/ControllerSessionStateMachine.swift index 25f9a3810..b6c25568a 100644 --- a/Sources/WalletConnectSign/Engine/Controller/ControllerSessionStateMachine.swift +++ b/Sources/WalletConnectSign/Engine/Controller/ControllerSessionStateMachine.swift @@ -32,7 +32,6 @@ final class ControllerSessionStateMachine { try validateControlledAcknowledged(session) try Namespace.validate(namespaces) logger.debug("Controller will update methods") - try session.updateNamespaces(namespaces) sessionStore.setSession(session) try await networkingInteractor.request(.wcSessionUpdate(SessionType.UpdateParams(namespaces: namespaces)), onTopic: topic) } From 2a52a32ca8e9f40a877b7d047664182cc85750ea Mon Sep 17 00:00:00 2001 From: Derek Date: Fri, 15 Jul 2022 09:13:55 +0200 Subject: [PATCH 2/3] feat: parallelizes build --- .github/actions/ci/action.yml | 60 +++++++++++++++++++++++++++++++++++ .github/workflows/swift.yml | 46 ++++----------------------- 2 files changed, 66 insertions(+), 40 deletions(-) create mode 100644 .github/actions/ci/action.yml diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml new file mode 100644 index 000000000..4e6735c13 --- /dev/null +++ b/.github/actions/ci/action.yml @@ -0,0 +1,60 @@ +name: 'ci' +description: 'Executes Swift specific CI steps' +inputs: + type: + description: 'The type of CI step to run' + required: true + +runs: + using: "composite" + steps: + # Package builds + - name: Run tests + if: inputs.type == 'unit-tests' + shell: bash + run: "xcodebuild \ + -project Example/ExampleApp.xcodeproj \ + -scheme WalletConnect \ + -clonedSourcePackagesDirPath SourcePackages \ + -sdk iphonesimulator" + + # Integration tests + - name: Run integration tests + if: inputs.type == 'integration-tests' + shell: bash + run: "xcodebuild \ + -project Example/ExampleApp.xcodeproj \ + -scheme IntegrationTests \ + -clonedSourcePackagesDirPath SourcePackages \ + -destination 'platform=iOS Simulator,name=iPhone 13' test" + + # Wallet build + - name: Build Example Wallet + if: inputs.type == 'build-example-wallet' + shell: bash + run: "xcodebuild \ + -project Example/ExampleApp.xcodeproj \ + -scheme Wallet \ + -clonedSourcePackagesDirPath SourcePackages \ + -sdk iphonesimulator" + + # DApp build + - name: Build Example Dapp + if: inputs.type == 'build-example-dapp' + shell: bash + run: "xcodebuild \ + -project Example/ExampleApp.xcodeproj \ + -scheme DApp \ + -clonedSourcePackagesDirPath SourcePackages \ + -sdk iphonesimulator" + + # UI tests + - name: UI Tests + if: inputs.type == 'ui-tests' + shell: bash + run: "xcodebuild \ + -project Example/ExampleApp.xcodeproj \ + -scheme UITests \ + -clonedSourcePackagesDirPath SourcePackages \ + -destination 'platform=iOS Simulator,name=iPhone 13' test" + continue-on-error: true diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 7dc66c564..433ae80b7 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -9,6 +9,9 @@ on: jobs: build: runs-on: macos-latest + strategy: + matrix: + test-type: [unit-tests, integration-tests, build-example-wallet, build-example-dapp, ui-tests] steps: - uses: actions/checkout@v2 @@ -27,43 +30,6 @@ jobs: restore-keys: | ${{ runner.os }}-spm- - # Package builds - - name: Run tests - run: "xcodebuild \ - -project Example/ExampleApp.xcodeproj \ - -scheme WalletConnect \ - -clonedSourcePackagesDirPath SourcePackages \ - -sdk iphonesimulator" - - # Integration tests - - name: Run integration tests - run: "xcodebuild \ - -project Example/ExampleApp.xcodeproj \ - -scheme IntegrationTests \ - -clonedSourcePackagesDirPath SourcePackages \ - -destination 'platform=iOS Simulator,name=iPhone 13' test" - - # Wallet build - - name: Build Example Wallet - run: "xcodebuild \ - -project Example/ExampleApp.xcodeproj \ - -scheme Wallet \ - -clonedSourcePackagesDirPath SourcePackages \ - -sdk iphonesimulator" - - # DApp build - - name: Build Example Dapp - run: "xcodebuild \ - -project Example/ExampleApp.xcodeproj \ - -scheme DApp \ - -clonedSourcePackagesDirPath SourcePackages \ - -sdk iphonesimulator" - - # UI tests - - name: UI Tests - run: "xcodebuild \ - -project Example/ExampleApp.xcodeproj \ - -scheme UITests \ - -clonedSourcePackagesDirPath SourcePackages \ - -destination 'platform=iOS Simulator,name=iPhone 13' test" - continue-on-error: true + - uses: ./.github/actions/ci + with: + type: ${{ matrix.test-type }} From 89c39292e340b9ffced5094d93aca98c807ef13d Mon Sep 17 00:00:00 2001 From: Derek Date: Fri, 15 Jul 2022 09:32:13 +0200 Subject: [PATCH 3/3] feat: uses concurrency to cancel obsolete runs --- .github/workflows/swift.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 433ae80b7..c0d8d4d36 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -6,6 +6,15 @@ on: pull_request: branches: [ main, develop ] +concurrency: + # Support push/pr as event types with different behaviors each: + # 1. push: queue up builds by branch + # 2. pr: only allow one run per PR + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} + # If there is already a workflow running for the same pull request, cancel it + # For non-PR triggers queue up builds + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build: runs-on: macos-latest