Skip to content

Commit

Permalink
feat: add schema check action
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Nov 8, 2024
1 parent 1e38e2e commit 8ef3941
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/schema-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Schema Checker

on:
push:
workflow_dispatch:

jobs:
schemaChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup JDK 22
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 22
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/io/aklivity/zilla
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: ./mvnw -B -U -nsu -Ddocker.logStdout -Ddocker.verbose -DskipTests install jacoco:report-aggregate
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}

- name: Checkout docs repo
uses: actions/checkout@v4
with:
repository: aklivity/zilla-docs

- name: Build latest schema
run: |
CONTAINER_ID=$(docker run -d --rm -e ZILLA_INCUBATOR_ENABLED=true ghcr.io/aklivity/zilla:develop-SNAPSHOT start -v -Pzilla.engine.verbose.schema.plain);
sleep 5;
docker logs $CONTAINER_ID > ./.check-schema/zilla-schema.json 2>&1;
docker stop $CONTAINER_ID;
sed -i '1,2d' ./.check-schema/zilla-schema.json;
sed -i '$d' ./.check-schema/zilla-schema.json;
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install deps
run: pnpm install-check-schema

- name: Schema Checker
run: pnpm check-schema

0 comments on commit 8ef3941

Please sign in to comment.