diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d26e8fad..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Tests - -on: - push: - branches: [ main ] - paths-ignore: [ README.md ] - pull_request: - branches: [ main ] - paths-ignore: [ README.md ] - workflow_dispatch: - -jobs: - formatlint: - name: Format linting - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Pull formatting docker image - run: docker pull ghcr.io/nicklockwood/swiftformat:latest - - name: Run format linting - run: docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo --lint - - macos: - name: Test on macOS - runs-on: macos-latest - steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - uses: actions/checkout@v3 - - name: Build and test - run: swift test --parallel --enable-test-discovery - - linux: - name: Test on Linux - runs-on: ubuntu-latest - steps: - - uses: swift-actions/setup-swift@v2 - - uses: actions/checkout@v3 - - name: Test - run: swift test --parallel --enable-code-coverage - - name: Get test coverage html - run: | - llvm-cov show \ - $(swift build --show-bin-path)/GraphQLPackageTests.xctest \ - --instr-profile $(swift build --show-bin-path)/codecov/default.profdata \ - --ignore-filename-regex="\.build|Tests" \ - --format html \ - --output-dir=.test-coverage - - name: Upload test coverage html - uses: actions/upload-artifact@v3 - with: - name: test-coverage-report - path: .test-coverage - - android: - name: Test on Android - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Test - uses: skiptools/swift-android-action@v2 - - backcompat-ubuntu-22_04: - name: Test Swift ${{ matrix.swift }} on Ubuntu 22.04 - runs-on: ubuntu-22.04 - strategy: - matrix: - swift: ["5.8", "5.9", "5.10", "6.0"] - steps: - - uses: swift-actions/setup-swift@v2 - with: - swift-version: ${{ matrix.swift }} - - uses: actions/checkout@v3 - - name: Test - run: swift test --parallel - diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..ee4c9b8a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,12 @@ +name: test +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: +jobs: + lint: + uses: graphqlswift/ci/.github/workflows/lint.yaml@main + test: + uses: graphqlswift/ci/.github/workflows/test.yaml@main diff --git a/.gitignore b/.gitignore index f10a07cf..2a5cfeb1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,7 @@ .swiftpm/ ### CI Artifacts ### -/.test-coverage \ No newline at end of file +/.test-coverage + +### VS Code ### +.vscode/ diff --git a/Sources/GraphQL/Subscription/Subscribe.swift b/Sources/GraphQL/Subscription/Subscribe.swift index e6f393d5..8236b3d5 100644 --- a/Sources/GraphQL/Subscription/Subscribe.swift +++ b/Sources/GraphQL/Subscription/Subscribe.swift @@ -51,7 +51,6 @@ func subscribe( return sourceFuture.map { sourceResult -> SubscriptionResult in if let sourceStream = sourceResult.stream { let subscriptionStream = sourceStream.map { eventPayload -> Future in - // For each payload yielded from a subscription, map it over the normal // GraphQL `execute` function, with `payload` as the rootValue. // This implements the "MapSourceToResponseEvent" algorithm described in