Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add schema check action #1326

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
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