Skip to content

Commit

Permalink
Add CI job to check graphql schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavlrsn committed Jan 20, 2025
1 parent 9a5725f commit d6213b7
Show file tree
Hide file tree
Showing 4 changed files with 395 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,61 @@ jobs:

- run: npm run langs:check

check-graphql:
runs-on: ubuntu-latest
timeout-minutes: 15

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

- name: Setup project
uses: ./.github/actions/setup-project
with:
CACHE_VERSION: ${{ secrets.CACHE_VERSION }}

- run: npm run graphql:check

check-graphql-alt:
runs-on: ubuntu-latest
timeout-minutes: 15

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

- name: Setup project
uses: ./.github/actions/setup-project
with:
CACHE_VERSION: ${{ secrets.CACHE_VERSION }}

- name: Run GraphQL update
run: |
npm run graphql:update | tee /dev/stdout
- name: Check for schema changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: GraphQL schema is not up to date. Please update the schema and commit changes." && exit 1
else
echo "GraphQL schema is up to date."
fi
check-codegen:
runs-on: ubuntu-latest
timeout-minutes: 15

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

- name: Setup project
uses: ./.github/actions/setup-project
with:
CACHE_VERSION: ${{ secrets.CACHE_VERSION }}

- run: npm run graphql:codegen-check

build:
runs-on: ubuntu-latest

Expand Down
298 changes: 298 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@icons-pack/react-simple-icons": "^10.0.0",
"@opencollective/taxes": "5.0.0",
"@opencollective/trix": "2.1.6",
"@parcel/watcher": "^2.5.0",
"@popperjs/core": "2.11.8",
"@radix-ui/react-accordion": "1.2.1",
"@radix-ui/react-alert-dialog": "1.1.2",
Expand Down Expand Up @@ -168,6 +169,8 @@
"docs:generate:contribution-flow": "tsx ./scripts/docs/contribution-flow.js",
"git:clean": "cross-env ./scripts/git_clean.sh",
"graphql:codegen": "graphql-codegen --config scripts/config/graphql-codegen.ts",
"graphql:codegen-check": "graphql-codegen --config scripts/config/graphql-codegen.ts --check",
"graphql:check": "cross-env scripts/check_graphql_schema.sh",
"graphql:get-schema": "npm-run-all graphql:updateV1 graphql:updateV2",
"graphql:update": "npm-run-all graphql:updateV1 graphql:updateV2 graphql:codegen",
"graphql:updateV1": "tsx ./scripts/update-gql-schemas.js http://localhost:3060/graphql/v1 lib/graphql/schema.graphql && prettier lib/graphql/schema.graphql --write",
Expand Down
Loading

0 comments on commit d6213b7

Please sign in to comment.