From 3855333880e0fa55d98cb3fd94865e0adbbb18a2 Mon Sep 17 00:00:00 2001 From: FestplattenSchnitzel Date: Tue, 2 Nov 2021 15:30:33 +0000 Subject: [PATCH] Add schema validation CI job --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0612008766..55d3e86dd6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,6 +86,27 @@ lint: - ./tools/check-for-unattached-signatures.py || set_error - exit $EXITVALUE +schema validation: + image: node:alpine + except: + - master@fdroid/fdroiddata + - pipelines + - schedules + - triggers + before_script: + - apk add git + - npm -g install ajv-cli + script: + - ajv compile -s schemas/*.json || exit 1 + - git fetch https://gitlab.com/fdroid/fdroiddata.git + - set -xe + - app_ids=$(git diff --name-only --diff-filter=d FETCH_HEAD...HEAD "metadata/*.yml") + - if [ -n "$appids" ]; then + for app_id in $app_ids; do + ajv validate -s schemas/metadata.json -d "$app_id"; + done + fi + trigger-issuebot: image: alpine except: