Skip to content

Commit 6d2f710

Browse files
committed
add CI
1 parent 675433f commit 6d2f710

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Validation
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-python@v5
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install jsonschema requests

validate_probes.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import glob
2+
import jsonschema
3+
import json
4+
import requests
5+
6+
schema_url = "https://raw.githubusercontent.com/SpikeInterface/probeinterface/main/resources/probe.json.schema"
7+
8+
response = requests.get(schema_url)
9+
response.raise_for_status()
10+
11+
files = glob.glob("*/*/*.json")
12+
13+
print("Validating the following files:")
14+
for file in files:
15+
print(file)
16+
with open(file) as f:
17+
data = json.load(f)
18+
jsonschema.validate(data, response.json())

0 commit comments

Comments
 (0)