diff --git a/.github/.editorconfig b/.github/.editorconfig new file mode 100644 index 0000000..0fad08c --- /dev/null +++ b/.github/.editorconfig @@ -0,0 +1,3 @@ +[*.yaml] +indent_style = space +indent_size = 2 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6ba62cb..d1bc307 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,3 @@ -* @aws-amplify/amplify-ios +- @aws-amplify/amplify-ios -/.github/CODEOWNERS @aws-amplify/amplify-ios-admins \ No newline at end of file +/.github/CODEOWNERS @aws-amplify/amplify-ios-admins diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml new file mode 100644 index 0000000..b5e2221 --- /dev/null +++ b/.github/workflows/unit-test.yaml @@ -0,0 +1,47 @@ +name: Unit Test + +on: + pull_request: + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + unit-test: + name: "Run Unit Test" + strategy: + fail-fast: false + matrix: + include: + - scheme: AWSAppSyncApolloExtensions + os: iOS + sdk: iphonesimulator + destination: platform=iOS Simulator,name=iPhone 15,OS=latest + - scheme: AWSAppSyncApolloExtensions + os: macOS + sdk: macosx + destination: platform=OS X,arch=arm64 + - scheme: AWSAppSyncApolloExtensions + os: watchOS + sdk: watchsimulator + destination: platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=latest + - scheme: AWSAppSyncApolloExtensions + os: tvOS + sdk: appletvsimulator + destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest + + runs-on: macos-14 + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + persist-credentials: false + - name: ${{ matrix.os }} + run: | + xcodebuild test \ + -scheme ${{ matrix.scheme }} \ + -destination "${{ matrix.destination }}" \ + -sdk ${{ matrix.sdk }} \ + -only-testing:"${{ matrix.scheme }}Tests" | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]} diff --git a/.gitignore b/.gitignore index e650442..f68e2e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store /.build +build/ /Packages xcuserdata/ DerivedData/ diff --git a/Tests/AWSAppSyncApolloExtensionsTests/Websocket/LocalWebSocketServer.swift b/Tests/AWSAppSyncApolloExtensionsTests/Websocket/LocalWebSocketServer.swift index bdf66ca..b20ae8f 100644 --- a/Tests/AWSAppSyncApolloExtensionsTests/Websocket/LocalWebSocketServer.swift +++ b/Tests/AWSAppSyncApolloExtensionsTests/Websocket/LocalWebSocketServer.swift @@ -96,7 +96,7 @@ class LocalWebSocketServer { func sendTransientFailureToConnections() { self.connections.forEach { - var metadata = NWProtocolWebSocket.Metadata(opcode: .close) + let metadata = NWProtocolWebSocket.Metadata(opcode: .close) metadata.closeCode = .protocolCode(NWProtocolWebSocket.CloseCode.Defined.internalServerError) $0.send( content: nil,