Skip to content

Add eyetracking EEG dataset #1738

Add eyetracking EEG dataset

Add eyetracking EEG dataset #1738

name: validate_datasets
on:
push:
branches: [master, main]
tags: ['*']
pull_request:
types: [opened, synchronize, reopened, edited]
branches: [master, main, 'bep*']
schedule:
- cron: "0 4 * * 1"
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
# Prepare the matrix dynamically based on whether a bids-specification PR is referenced
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
spec_pr: ${{ steps.find-pr.outputs.spec_pr }}
val_pr: ${{ steps.find-pr.outputs.val_pr }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Get full history for commit message scanning
- name: Check for bids-specification PR reference
id: find-pr
run: |
# Check PR description if this is a PR
if [ "${{ github.event_name }}" == "pull_request" ]; then
cat << 'EOF' > /tmp/pr_body.txt
${{ github.event.pull_request.body }}
EOF
SPEC_PR=$(grep -oP 'BIDS Specification PR:\s*(https://github\.com/bids-standard/bids-specification/pulls?/|bids-standard/bids-specification#)*\K[0-9]+' /tmp/pr_body.txt | head -1 || true)
[ -n "$SPEC_PR" ] && echo "spec_pr=$SPEC_PR" >> $GITHUB_OUTPUT || :
VAL_PR=$(grep -oP 'BIDS Validator PR:\s*(https://github\.com/bids-standard/bids-validator/pulls?/|bids-standard/bids-validator#)*\K[0-9]+' /tmp/pr_body.txt | head -1 || true)
[ -n "$VAL_PR" ] && echo "val_pr=$VAL_PR" >> $GITHUB_OUTPUT || :
fi
- name: Set matrix
id: set-matrix
run: |
EXTRA_ITEM=''
if [ -n "${{ steps.find-pr.outputs.spec_pr }}${{ steps.find-pr.outputs.val_pr }}" ]; then
EXTRA_ITEM=', "dev-prs"'
fi
echo "matrix=[\"stable\", \"main\", \"dev\"${EXTRA_ITEM}]" >> $GITHUB_OUTPUT
build:
needs: prepare-matrix
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
bids-validator: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
runs-on: ${{ matrix.platform }}
env:
SPEC_PR: ${{ needs.prepare-matrix.outputs.spec_pr }}
VAL_PR: ${{ needs.prepare-matrix.outputs.val_pr }}
TZ: Europe/Berlin
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v6
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Install BIDS validator (stable)
if: matrix.bids-validator == 'stable'
run: |
deno install -Agf -n bids-validator jsr:@bids/validator
- name: Install BIDS validator (main)
if: matrix.bids-validator == 'main'
run: |
# If unmerged validator PRs are needed for testing, you can use
# https://github.com/<FORK>/bids-validator/raw/<BRANCH>/bids-validator/src/bids-validator.ts
deno install -Agf https://github.com/bids-standard/bids-validator/raw/deno-build/bids-validator.js
- name: Install BIDS validator (dev)
if: ( matrix.bids-validator == 'dev' ) || ( matrix.bids-validator == 'dev-prs' && env.VAL_PR == '' )
run: |
git clone -b dev https://github.com/bids-standard/bids-validator/ ../bids-validator
cd ../bids-validator
deno compile -A -o $HOME/.deno/bin/bids-validator src/bids-validator.ts
- name: Install BIDS validator (dev-prs with VAL_PR)
if: matrix.bids-validator == 'dev-prs' && env.VAL_PR != ''
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
# Fetch PR info using gh cli (handles auth automatically)
fork_url=$(gh api repos/bids-standard/bids-validator/pulls/${{ env.VAL_PR }} --jq '.head.repo.html_url')
branch=$(gh api repos/bids-standard/bids-validator/pulls/${{ env.VAL_PR }} --jq '.head.ref')
echo "I: Received fork_url=$fork_url branch=$branch"
if [ "$fork_url" = "null" ] || [ -z "$fork_url" ]; then
echo "E: Failed to get PR info for VAL_PR=${{ env.VAL_PR }}"
exit 1
fi
# Perform the same installation as in "dev"
git clone -b "$branch" "$fork_url" ../bids-validator
cd ../bids-validator
deno compile -A -o $HOME/.deno/bin/bids-validator src/bids-validator.ts
- name: Display versions and environment information
run: |
echo $TZ
date
which deno && echo "deno\n----" && deno --version || true
echo "node\n----"; node --version
echo "npm\n----"; npm --version
echo "bids-validator"; bids-validator --version
- name: Check that no large files are present
if: "matrix.bids-validator == 'stable'"
run: |
echo "Checking for big files ..."
found=`find . -not -path "./.git*" -type f -size +1M`
if [ "$found" == "" ]
then
echo "No big files present, great!"
else
echo "Found big files:"
echo "$found"
exit 1;
fi
- name: Skip stable validation for datasets with unreleased validator features
# Replace ${EMPTY} with dataset patterns, when this is needed
# Reset to "for DS in ${EMPTY}; ..." after a validator release
run: for DS in ${EMPTY}; do touch $DS/.SKIP_VALIDATION; done
if: matrix.bids-validator == 'stable'
- name: Skip main validation for datasets with unreleased spec features
# Replace ${EMPTY} with dataset patterns, when this is needed
# Reset to "for DS in ${EMPTY}; ..." after a spec release
run: for DS in ${EMPTY}; do touch $DS/.SKIP_VALIDATION; done
if: matrix.bids-validator != 'dev'
- name: Set BIDS_SCHEMA variable for dev version
if: matrix.bids-validator == 'dev'
# When proposing new features, schema changes may be necessary.
# Update this URL to the schema.json from PRs to the spec, when needed.
# If this variable is unset, dev will generally track the latest development
# release of https://jsr.io/@bids/schema
run: echo BIDS_SCHEMA=https://bids-specification.readthedocs.io/en/latest/schema.json >> $GITHUB_ENV
- name: Set BIDS_SCHEMA variable for dev-prs version
if: matrix.bids-validator == 'dev-prs' && env.SPEC_PR != ''
# Use the readthedocs PR preview build for the schema
run: |
echo "Using schema from bids-specification PR #${{ env.SPEC_PR }}"
echo BIDS_SCHEMA=https://bids-specification--${{ env.SPEC_PR }}.org.readthedocs.build/en/${{ env.SPEC_PR }}/schema.json >> $GITHUB_ENV
- name: Validate all BIDS datasets using bids-validator
run: |
cat ./run_tests.sh
./run_tests.sh