Skip to content

Commit 36eae45

Browse files
authored
Merge pull request #5 from bendichter/add_ci
add CI
2 parents 675433f + 7ae3e90 commit 36eae45

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/ci.yml

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