Check Grats artifacts in CI

This commit is contained in:
Jordan Eldredge 2025-07-07 15:33:05 -07:00
parent 6ce866f48c
commit b090082dfa
2 changed files with 33 additions and 0 deletions

View file

@ -29,6 +29,8 @@ jobs:
- name: Lint and type-check
run: |
npx turbo lint type-check
- name: Validate Grats generated files are up-to-date
run: ./scripts/validate-grats.sh
- name: Run tests
run: |
touch packages/skin-database/config.js

31
scripts/validate-grats.sh Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
# Script to validate that Grats generated files are up-to-date
# This ensures that developers have run Grats locally and committed the generated files
set -e
echo "🔍 Validating Grats generated files are up-to-date..."
# Run Grats to regenerate schema files
echo "Running Grats to regenerate schema files..."
npx turbo run grats --filter=skin-database
# Check if the generated files were modified
CHANGES=$(git status --porcelain packages/skin-database/api/graphql/)
if [ -n "$CHANGES" ]; then
echo "❌ Grats generated files are out of date!"
echo ""
echo "The following generated files have changes after running Grats:"
echo "$CHANGES"
echo ""
echo "Please run the following command locally and commit the changes:"
echo " npx turbo run grats --filter=skin-database"
echo ""
echo "Diff of changes:"
git diff packages/skin-database/api/graphql/
exit 1
else
echo "✅ Grats generated files are up-to-date"
fi