Skip to content
Merged
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
33 changes: 32 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,40 @@ jobs:
tags: datasqrl/examples:${{ matrix.tag && matrix.tag != '' && matrix.tag || matrix.path }}
platforms: linux/amd64,linux/arm64

lint-graphql:
name: Lint GraphQL Schemas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Lint GraphQL schemas
run: |
SCHEMAS=$(find . -name "*.graphqls" -type f)
if [ -z "$SCHEMAS" ]; then
echo "No GraphQL schemas found"
exit 0
fi

LINT_OPTS="--rules fields-are-camel-cased,types-are-capitalized,enum-values-all-caps,input-object-values-are-camel-cased"
IGNORE='{"fields-are-camel-cased":["Query.Shipment","Query.Vehicle","Query.Customer"]}'
FAILED=0

for schema in $SCHEMAS; do
echo "::group::Checking $schema"
output=$(docker run --rm -v "$PWD":/app -w /app node:18-slim npx graphql-schema-linter $LINT_OPTS --ignore "$IGNORE" "$schema" 2>&1)
result=$?
echo "$output" | grep -v "^npm"
echo "::endgroup::"
if [ $result -ne 0 ]; then
FAILED=1
fi
done

exit $FAILED

ci-summary:
name: build ✅ summary
needs: build
needs: [build, lint-graphql]
runs-on: ubuntu-latest
if: always()
steps:
Expand Down
Loading