Skip to content

Fix issue here source directive was not getting mapped to the correct types after multiple transformations #20709

Fix issue here source directive was not getting mapped to the correct types after multiple transformations

Fix issue here source directive was not getting mapped to the correct types after multiple transformations #20709

Workflow file for this run

name: test
on:
pull_request:
push:
branches:
- master
env:
CI: true
NODE_TLS_REJECT_UNAUTHORIZED: 0
GH_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LC_ALL: en-US
REDIS_HOST: localhost
REDIS_PORT: 6379
APOLLO_ELV2_LICENSE: accept
jobs:
lint:
uses: the-guild-org/shared-config/.github/workflows/lint.yml@v1
with:
node-version-file: .node-version
script: yarn prettier:check && yarn ci:lint
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
typecheck:
name: typecheck
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: the-guild-org/shared-config/setup@v1
name: set up env
with:
node-version-file: .node-version
- name: Prepare for build
run: yarn prebuild
- name: typecheck
run: yarn typecheck
unit:
name: unit / node ${{matrix.node-version}}
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 18
- 20
- 22
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: the-guild-org/shared-config/setup@v1
name: set up env
with:
node-version: ${{matrix.node-version}}
- name: Cache Jest
uses: actions/cache@v4
with:
path: .cache/jest
key: ${{ runner.os }}-${{matrix.node-version}}-jest-unit-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{runner.os}}-${{matrix.node-version}}-jest-unit-
- name: Generate config schema
run: yarn generate-config-schema
- name: Prepare for build
run: yarn prebuild
- name: Run Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: yarn test
unit-leaks:
needs: [unit]
name: unit / leak / node ${{matrix.node-version}}
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- uses: the-guild-org/shared-config/setup@v1
name: set up env
with:
node-version: ${{matrix.node-version}}
- name: Cache Jest
uses: actions/cache@v4
with:
path: .cache/jest
key: ${{ runner.os }}-${{matrix.node-version}}-jest-unit-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{runner.os}}-${{matrix.node-version}}-jest-unit-
- name: Remove node-libcurl
run: rm -rf node_modules/node-libcurl
- name: Prepare for build
run: yarn prebuild
- name: Run Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: yarn test:leak
integration:
needs: [unit]
name: integration / node ${{matrix.node-version}}
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 18
- 20
- 22
# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: docker
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
mysql:
image: genschsa/mysql-employees
env:
MYSQL_ROOT_PASSWORD: passwd
ports:
- 33306:3306
options:
--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s
--health-retries=3
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: the-guild-org/shared-config/setup@v1
name: set up env
with:
node-version: ${{matrix.node-version}}
- name: Cache Jest
uses: actions/cache@v4
with:
path: .cache/jest
key:
${{ runner.os }}-${{matrix.node-version}}-jest-integration-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{runner.os}}-${{matrix.node-version}}-jest-integration-
- name: Download Postgres Dump
run:
'curl
https://raw.githubusercontent.com/morenoh149/postgresDBSamples/master/worldDB-1.0/world.sql
-o /tmp/backup.sql'
- name: Load Postgres Data
uses: tj-actions/[email protected]
with:
database_url: 'postgres://postgres:docker@localhost:5432/postgres'
backup_file: '/tmp/backup.sql'
- name: Build
run: yarn build
- name: Build Test Artifacts
run: yarn build-test-artifacts
- name: Test
run: yarn test:integration
integration-leak:
needs: [integration]
name: integration / leak / node ${{matrix.node-version}}
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18]
# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: docker
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
mysql:
image: genschsa/mysql-employees
env:
MYSQL_ROOT_PASSWORD: passwd
ports:
- 33306:3306
options:
--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s
--health-retries=3
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- uses: the-guild-org/shared-config/setup@v1
name: set up env
with:
node-version: ${{matrix.node-version}}
- name: Cache Jest
uses: actions/cache@v4
with:
path: .cache/jest
key:
${{ runner.os }}-${{matrix.node-version}}-jest-integration-leak-${{
hashFiles('yarn.lock') }}
restore-keys: |
${{runner.os}}-${{matrix.node-version}}-jest-integration-leak-
- name: Download Postgres Dump
run:
'curl
https://raw.githubusercontent.com/morenoh149/postgresDBSamples/master/worldDB-1.0/world.sql
-o /tmp/backup.sql'
- name: Load Postgres Data
uses: tj-actions/[email protected]
with:
database_url: 'postgres://postgres:docker@localhost:5432/postgres'
backup_file: '/tmp/backup.sql'
- name: Build
run: yarn build
- name: Build Test Artifacts
run: yarn build-test-artifacts
- name: Remove node-libcurl
run: rm -rf node_modules/node-libcurl
- name: Run Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: yarn test:integration:leak
integrity-check:
needs: [typecheck]
name: integrity-check / node ${{matrix.node-version}}
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 18
- 20
- 22
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: the-guild-org/shared-config/setup@v1
name: set up env
with:
node-version: ${{matrix.node-version}}
- name: Build
run: yarn build
- name: Node.js integrity check
run: yarn bob check
e2e:
needs: [unit]
name:
e2e / runner ${{matrix.setup.serve-runner}} / os ${{ matrix.setup.os }} / node
${{matrix.setup.node-version}}
runs-on: ${{ matrix.setup.os }}
strategy:
fail-fast: false
matrix:
setup:
- serve-runner: node
node-version: 18
os: ubuntu-latest
- serve-runner: node
node-version: 20
os: ubuntu-latest
- serve-runner: node
node-version: 22
os: ubuntu-latest
- serve-runner: docker
node-version: 22
os: ubuntu-latest
- serve-runner: bin
node-version: 22
os: ubuntu-latest
- serve-runner: bin
node-version: 22
os: windows-latest
- serve-runner: bin
node-version: 22
# MacOS Arm64
os: macos-14
- serve-runner: bin
node-version: 22
# MacOS x86_64
os: macos-13
steps:
- name: checkout
uses: actions/checkout@v4
# Install Windows specific dependencies
- if: runner.os == 'Windows'
name: Disable Windows Defender
run: Set-MpPreference -DisableRealtimeMonitoring $true
shell: pwsh
- name: set up docker buildx
if: matrix.setup.serve-runner == 'docker'
uses: docker/setup-buildx-action@v3
- name: hash docker images
if: runner.os == 'Linux'
id: hash-docker-images
# get all "image: '" occurrences in the e2e tests and hash them
run: |
echo "result=$(grep -r -h "image: '" e2e | shasum | base64)" >> "$GITHUB_OUTPUT"
shell: bash
- name: cache docker images
if: runner.os == 'Linux'
uses: ScribeMD/[email protected]
continue-on-error: true
with:
key: docker-images-${{ runner.os }}-${{ steps.hash-docker-images.outputs.result }}
- name: set up env
uses: the-guild-org/shared-config/setup@v1
with:
node-version: ${{matrix.setup.node-version}}
- name: prepare
run: yarn prebuild
- name: bundle
if: matrix.setup.serve-runner == 'docker' || matrix.setup.serve-runner == 'bin'
env:
E2E_SERVE_RUNNER: ${{matrix.setup.serve-runner}}
run: yarn workspace @graphql-mesh/serve-cli bundle
- name: build & relink # we need to build for binary because it'll use the nearby node_modules
if: matrix.setup.serve-runner == 'bin'
run: yarn build && yarn install
shell: bash
- name: package binary
if: matrix.setup.serve-runner == 'bin'
working-directory: packages/serve-cli
run: yarn workspace @graphql-mesh/serve-cli package-binary
- name: bake
if: matrix.setup.serve-runner == 'docker'
uses: docker/bake-action@v5
with:
targets: e2e
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
# we must load so that the e2e tests can use the cached image
# also, in order for loading to work - we must define the platform above
load: true
- name: test
timeout-minutes: 60
env:
E2E_SERVE_RUNNER: ${{matrix.setup.serve-runner}}
run: |
yarn test:e2e --detectOpenHandles --forceExit
apollo-federation-compatibility:
needs: [unit]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: the-guild-org/shared-config/setup@v1
name: setup env
with:
node-version-file: .node-version
- name: Install Rover
run: npm install -g @apollo/rover
- name: Build Packages
run: yarn build
- name: Run Mesh Compose
run: yarn workspace example-apollo-federation-compatibility mesh:compose
- name: Run Bundler
run: yarn workspace example-apollo-federation-compatibility build
- name: Apollo Federation Subgraph Compatibility
uses: apollographql/federation-subgraph-compatibility@v2
with:
workingDirectory: examples/v1-next/apollo-federation-compatibility
compose: docker-compose.yaml
schema: schema.graphql
path: /graphql
token: ${{ secrets.GITHUB_TOKEN }}
failOnWarning: true
failOnRequired: true
debug: true
loadtest-e2e:
needs: [e2e]
name: node ${{matrix.node-version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 18
- 20
- 22
steps:
- name: checkout
uses: actions/checkout@v4
- uses: the-guild-org/shared-config/setup@v1
name: setup env
with:
node-version: ${{matrix.node-version}}
- name: Prepare for build
run: yarn prebuild
- name: hash docker images
id: hash-docker-images
# get all "image: '" occurrences in the e2e tests and hash them
run: |
echo "result=$(grep -r -h "image: '" e2e | shasum | base64)" >> "$GITHUB_OUTPUT"
- name: cache docker images
uses: enisdenjo/[email protected]
with:
key: docker-images-${{ runner.os }}-${{ steps.hash-docker-images.outputs.result }}
- name: loadtest
run: yarn loadtest:e2e