remove backend part #20
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: Validate generated code | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
validate-generated-code: | |
name: Validate generated code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: npm | |
cache-dependency-path: "**/package-lock.json" | |
- name: Install login-service dependencies | |
run: ./gradlew login-service:npm_ci | |
- name: Validate generated code | |
shell: bash {0} | |
run: | | |
./gradlew api-internal:bootRun --args="--server.port=8081 --gropius.core.createIndicesOnStartup=false" --no-daemon & | |
gradlew_pid=$! | |
schema_endpoint="http://localhost:8081/sdl" | |
c=0 | |
until curl -s -f -o /dev/null $schema_endpoint | |
do | |
((c++)) | |
if ((c > 120)); then | |
echo "Failed to get graphql schema: timeout" | |
exit 1 | |
fi | |
echo "Waiting for server" | |
sleep 2 | |
done | |
cd login-service | |
echo "Validating login-service generated code" | |
if ! npm run generate-model; then | |
echo "Failed to generate model" | |
exit 1 | |
fi | |
git status | |
git diff | |
if [[ `git status --porcelain` ]]; then | |
echo "Outdated generated code in login-service" | |
exit 1 | |
else | |
echo "login-service up to date" | |
fi | |
kill $gradlew_pid |