validate_datasets #1189
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: validate_datasets | |
on: | |
push: | |
branches: ['**'] | |
pull_request: | |
branches: ['**'] | |
create: | |
branches: [master] | |
tags: ['**'] | |
schedule: | |
- cron: "0 4 * * 1" | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
bids-validator: [stable, main, dev, legacy] | |
runs-on: ${{ matrix.platform }} | |
env: | |
TZ: Europe/Berlin | |
FORCE_COLOR: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
if: matrix.bids-validator == 'legacy' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: denoland/setup-deno@v2 | |
if: matrix.bids-validator != 'legacy' | |
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 | |
shell: bash | |
- 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 | |
shell: bash | |
- name: Install BIDS validator (dev) | |
if: matrix.bids-validator == 'dev' | |
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 | |
shell: bash | |
- name: Install BIDS validator (legacy) | |
if: "matrix.bids-validator == 'legacy'" | |
run: | | |
npm install -g bids-validator | |
- 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 | |
shell: bash | |
- 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 +500k` | |
if [ "$found" == "" ] | |
then | |
echo "No big files present, great!" | |
else | |
echo "Found big files:" | |
echo "$found" | |
exit 1; | |
fi | |
shell: bash | |
- name: Skip legacy validation for post-legacy datasets | |
run: for DS in mrs_* dwi_deriv; do touch $DS/.SKIP_VALIDATION; done | |
if: matrix.bids-validator == 'legacy' | |
shell: bash | |
- name: Skip stable validation for datasets with unreleased features | |
run: for DS in dwi_deriv; do touch $DS/.SKIP_VALIDATION; done | |
if: matrix.bids-validator != 'dev' | |
shell: bash | |
- 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: Validate all BIDS datasets using bids-validator | |
run: | | |
cat ./run_tests.sh | |
./run_tests.sh | |
shell: bash |