mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
ci(json-validator): use venv
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
parent
5c4d0b7a4a
commit
4f808d2d67
1 changed files with 37 additions and 36 deletions
73
.github/workflows/json-validator.yml
vendored
73
.github/workflows/json-validator.yml
vendored
|
|
@ -1,36 +1,37 @@
|
||||||
name: Json Validator
|
name: Json Validator
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '**.json'
|
- '**.json'
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '**.json'
|
- '**.json'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
json-validator:
|
json-validator:
|
||||||
name: Json Validator
|
name: Json Validator
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Validate Json
|
- name: Validate Json
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install python3-pip -y --no-install-recommends
|
sudo apt-get install python3-venv -y --no-install-recommends
|
||||||
pip3 install json-spec
|
python3 -m venv venv
|
||||||
export PATH="$PATH:/home/runner/.local/bin"
|
. venv/bin/activate
|
||||||
if ! json validate --schema-file=php/containers-schema.json --document-file=php/containers.json; then
|
pip3 install json-spec
|
||||||
exit 1
|
if ! json validate --schema-file=php/containers-schema.json --document-file=php/containers.json; then
|
||||||
fi
|
exit 1
|
||||||
JSON_FILES="$(find ./community-containers -name '*.json')"
|
fi
|
||||||
mapfile -t JSON_FILES <<< "$JSON_FILES"
|
JSON_FILES="$(find ./community-containers -name '*.json')"
|
||||||
for file in "${JSON_FILES[@]}"; do
|
mapfile -t JSON_FILES <<< "$JSON_FILES"
|
||||||
json validate --schema-file=php/containers-schema.json --document-file="$file" 2>&1 | tee -a ./json-validator.log
|
for file in "${JSON_FILES[@]}"; do
|
||||||
done
|
json validate --schema-file=php/containers-schema.json --document-file="$file" 2>&1 | tee -a ./json-validator.log
|
||||||
if grep -q "document does not validate with schema.\|invalid JSONFile" ./json-validator.log; then
|
done
|
||||||
exit 1
|
if grep -q "document does not validate with schema.\|invalid JSONFile" ./json-validator.log; then
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue