Skip to content

Schema Tests

Schema Tests #120

Workflow file for this run

name: Schema Tests
on:
push:
branches: [ "main", "staging"]
pull_request:
branches: [ "main", "staging" ]
workflow_run:
workflows: ["Generate schema human-readable documentation"]
types:
- completed
permissions:
contents: write
jobs:
generateTestSchemas:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Prepare test schemas
run: python ./tests/prepare_test_schemas.py json_schema/type tests
- name: Commit and push latest schemas if different
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: New test schema generated
file_pattern: 'tests/test_schemas/*.json'
validateTestSchemasAgainstInstances:
runs-on: ubuntu-latest
needs: generateTestSchemas
steps:
- uses: actions/checkout@v4
name: Check out repo
- name: Build biovalidator and test schemas
uses: addnab/docker-run-action@v3
with:
image: quay.io/ebi-ait/biovalidator:2.2.1
options: -v ${{ github.workspace }}/tests:/app
run: |
logs=$(
for instance in $( ls /app/test_instances/ );
do echo "$instance\n";
sh start.sh --schema /app/test_schemas/$instance --data /app/test_instances/$instance;
echo "\n";
done
)
if echo $logs | grep -q error; then
echo $logs
exit 1;
fi