Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci workflow for validating schema changes #6396

Open
wants to merge 1 commit into
base: dev-2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/schema-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate schema changes

on:
pull_request:
branches:
- dev-2.x

jobs:
validate-gtfs:
if: github.repository_owner == 'opentripplanner'
name: Validate GraphQL schema changes
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: 'Fetch dev.2.x for diffing'
run: |
git fetch origin dev-2.x --depth 1
- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install GraphQL Inspector
run: |
npm i --global @graphql-inspector/ci graphql @graphql-inspector/diff-command @graphql-inspector/graphql-loader @graphql-inspector/git-loader
- name: Validate GTFS GraphQL schema changes
run: |
graphql-inspector diff 'git:origin/dev-2.x:application/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls' 'application/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls'
- name: Validate Transmodel GraphQL schema changes
run: |
graphql-inspector diff 'git:origin/dev-2.x:application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql' 'application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql'
Loading