Move Schema Stitching #563
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
unit: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- 18 | |
- 20 | |
- 22 | |
name: Unit / Node v${{matrix.node-version}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up env | |
uses: the-guild-org/shared-config/setup@v1 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Build | |
run: yarn build | |
- name: Test | |
run: yarn test | |
leaks: | |
needs: [unit] | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- 18 | |
name: Leaks / Node v${{matrix.node-version}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up env | |
uses: the-guild-org/shared-config/setup@v1 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Test | |
run: yarn test:leaks | |
# TODO: various gateway runners | |
e2e: | |
needs: [unit] | |
runs-on: ${{ matrix.setup.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
setup: | |
- os: ubuntu-latest | |
gateway-runner: node | |
node-version: 18 | |
- os: ubuntu-latest | |
gateway-runner: node | |
node-version: 20 | |
- os: ubuntu-latest | |
gateway-runner: node | |
node-version: 22 | |
- os: ubuntu-latest | |
gateway-runner: docker | |
node-version: 22 | |
- os: ubuntu-latest | |
gateway-runner: bin | |
node-version: 22 | |
- os: windows-latest | |
gateway-runner: bin | |
node-version: 22 | |
- os: macos-14 # MacOS Arm64 | |
gateway-runner: bin | |
node-version: 22 | |
- os: macos-13 # MacOS x86_64 | |
gateway-runner: bin | |
node-version: 22 | |
name: E2E / ${{matrix.setup.gateway-runner == 'node' && format('Node v{0}', matrix.setup.node-version) || ''}}${{matrix.setup.gateway-runner == 'docker' && 'Docker' || ''}}${{matrix.setup.gateway-runner == 'bin' && format('Binary on {0}', matrix.setup.os) || ''}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- if: matrix.setup.gateway-runner == 'docker' | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- if: runner.os == 'Windows' | |
name: Install Windows SDK | |
uses: fbactions/setup-winsdk@v2 | |
with: | |
# we want exact version because the signtool path depends on it in package-binary.ts | |
winsdk-build-version: 18362 | |
- name: Set up env | |
uses: the-guild-org/shared-config/setup@v1 | |
with: | |
node-version: ${{matrix.setup.node-version}} | |
- if: runner.os == 'Linux' | |
name: Hash Docker Images | |
id: hash-docker-images | |
run: | # get all "image: '" occurrences in the e2e tests and hash them | |
echo "result=$(grep -r -h "image: '" e2e | shasum | base64)" >> "$GITHUB_OUTPUT" | |
- if: runner.os == 'Linux' | |
name: Cache Docker Images | |
uses: ScribeMD/[email protected] | |
continue-on-error: true | |
with: | |
key: docker-images-${{ runner.os }}-${{ steps.hash-docker-images.outputs.result }} | |
- name: Build | |
run: yarn build | |
- if: matrix.setup.gateway-runner == 'docker' || matrix.setup.gateway-runner == 'bin' | |
name: Bundle | |
env: | |
E2E_GATEWAY_RUNNER: ${{matrix.setup.gateway-runner}} | |
run: yarn workspace @graphql-hive/gateway bundle | |
- if: matrix.setup.gateway-runner == 'docker' | |
name: Bake | |
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 | |
- if: matrix.setup.gateway-runner == 'bin' | |
name: Package binary | |
run: yarn workspace @graphql-hive/gateway tsx scripts/package-binary | |
- name: Test | |
env: | |
E2E_GATEWAY_RUNNER: ${{matrix.setup.gateway-runner}} | |
run: yarn e2e:test |