From d6f98687d7e5cf0377312b79be6fa3460b84f905 Mon Sep 17 00:00:00 2001 From: Denis Badurina Date: Tue, 28 Feb 2023 19:55:46 +0100 Subject: [PATCH] Use Apollo's Federation compatibility checker action (#2511) --- .github/workflows/ci.yml | 47 +++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71a34380c6..171d54cb6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,25 +215,42 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Setup env - uses: the-guild-org/shared-config/setup@main + - name: Install Node + uses: actions/setup-node@v3 with: - nodeVersion: 18 - packageManager: pnpm + node-version: ${{ matrix.node-version }} + - name: Install pnpm + uses: pnpm/action-setup@v2.2.4 + with: + version: 7 + - name: Get pnpm store path + id: pnpm-store + run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Cache pnpm + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-store.outputs.PATH }} + key: ${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}- + - name: Install Dependencies + run: pnpm i - name: Build Packages run: pnpm build - - name: Create Bundle - working-directory: examples/apollo-federation-compatibility - run: pnpm build + - name: Bundle Apollo Federation Subgraph Example + run: pnpm --filter=example-apollo-federation-compatibility build - name: Install Rover run: curl -sSL https://rover.apollo.dev/nix/v0.11.1 | sh - name: Add Rover to PATH run: echo "$HOME/.rover/bin" >> $GITHUB_PATH - - name: Run Tests - working-directory: examples/apollo-federation-compatibility - run: pnpm test - env: - APOLLO_ELV2_LICENSE: accept - - name: Report - working-directory: examples/apollo-federation-compatibility - run: cat results.md > $GITHUB_STEP_SUMMARY + - name: Apollo Federation Subgraph Compatibility + uses: apollographql/federation-subgraph-compatibility@v1 + with: + workingDirectory: examples/apollo-federation-compatibility + compose: docker-compose.yaml + schema: schema.graphql + path: /graphql + token: ${{ secrets.GITHUB_TOKEN }} + failOnWarning: true + failOnRequired: true + debug: true