Skip to content

Commit 336a4fc

Browse files
authored
Merge pull request #433 from VisLab/main
Added action to validate sample datasets
2 parents 7bea87b + e4acdfa commit 336a4fc

File tree

2 files changed

+83
-2
lines changed

2 files changed

+83
-2
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: Validate HED BIDS Datasets
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches: [main]
8+
paths: ['datasets/**']
9+
pull_request:
10+
branches: [main]
11+
paths: ['datasets/**']
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
validate-datasets:
18+
name: Validate BIDS datasets
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install hedtools
31+
run: |
32+
pip install --upgrade pip
33+
pip install hedtools==0.7.1
34+
35+
- name: Validate all datasets
36+
run: |
37+
# Initialize variables
38+
failed_datasets=()
39+
exit_code=0
40+
41+
echo "Starting validation of all datasets in datasets/"
42+
echo "================================================"
43+
44+
# Loop through each dataset directory
45+
for dataset in datasets/*/; do
46+
# Skip if not a directory or if it's just the README
47+
if [ ! -d "$dataset" ] || [ "$dataset" == "datasets/README.md" ]; then
48+
continue
49+
fi
50+
51+
dataset_name=$(basename "$dataset")
52+
echo ""
53+
echo "Validating dataset: $dataset_name"
54+
echo "----------------------------------------"
55+
56+
# Run validation and capture exit code
57+
if validate_bids "$dataset" -s "*" --verbose; then
58+
echo "✓ $dataset_name: PASSED"
59+
else
60+
echo "✗ $dataset_name: FAILED"
61+
failed_datasets+=("$dataset_name")
62+
exit_code=1
63+
fi
64+
done
65+
66+
# Print summary
67+
echo ""
68+
echo "================================================"
69+
echo "Validation Summary"
70+
echo "================================================"
71+
72+
if [ ${#failed_datasets[@]} -eq 0 ]; then
73+
echo "All datasets validated successfully!"
74+
else
75+
echo "Failed datasets (${#failed_datasets[@]}):"
76+
for dataset in "${failed_datasets[@]}"; do
77+
echo " - $dataset"
78+
done
79+
fi
80+
81+
# Exit with failure if any dataset failed
82+
exit $exit_code

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ subdirectory contains Python Jupyter notebooks demonstrating calls to HedTools.
1818
For MATLAB support for HED see the [**hed-matlab**](https://github.com/hed-standard/hed-matlab)
1919
GitHub repository.
2020

21-
The [**docs**](https://github.com/hed-standard/hed-examples/tree/main/docs)
22-
subdirectory contains the source documentation for this and other HED resources.
21+
HED documentation and tutorials are available at [**hed-resources**](https://www.hedtags.org/hed-resources).
2322
The [**HED GitHub organization**](https://github.com/hed-standard/)
2423
gathers the HED supporting resources, all of which are open source.
2524

0 commit comments

Comments
 (0)