generated from datagouv/tableschema-template
-
Notifications
You must be signed in to change notification settings - Fork 14
39 lines (36 loc) · 1.27 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Vérification du respect des spécifications
on:
push:
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# AJV does not consider the geojson external schema, but the errors are more detailed
# so I put both validator,
- name: Validate JSON with AVJ.
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: schema_amenagements_cyclables.json
INPUT_JSONS: exemple-valide.json
# Install a python cli checker, `jsonschema` that have poor errors but can check that the example is a valid geojson
# (unlike ajv it resolves the external geojson schema)
- name: Installation Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Installation des dépendances
run: pip install -r requirements.txt
- name: Vérification du schéma et des fichiers d'exemples
run: |
jsonschema --instance exemple-valide.json schema_amenagements_cyclables.json