From 64ff8ec64faef231891913392aed7cf36376f509 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 17 Apr 2024 16:59:37 -0400 Subject: [PATCH 01/25] Add master-deno flavor of bids-validator to try --- .github/workflows/validate_datasets.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index d90ee7635..9f6f60b5f 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: platform: [ubuntu-latest, macos-latest, windows-latest] - bids-validator: [master, stable] + bids-validator: [master, stable, master-deno] runs-on: ${{ matrix.platform }} @@ -60,6 +60,26 @@ jobs: bash -c "npm install -g bids-validator-*.tgz" popd + - uses: denoland/setup-deno@v1.1.2 + if: "matrix.bids-validator == 'master-deno'" + with: + deno-version: v1.x + + - name: Install BIDS validator (master deno build) + if: "matrix.bids-validator == 'master-deno'" + run: | + pushd .. + git clone --depth 1 https://github.com/bids-standard/bids-validator + cd bids-validator/bids-validator + ./build.ts + ls -l dist/validator + # TODO: install properly somehow!! Yarik knows no "deno" + sudo ln -s $PWD/dist/validator /usr/bin/bids-validator + which -a bids-validator + bids-validator --version + bids-validator --help + popd + - name: Display versions and environment information run: | echo $TZ From 7c864baa973878c41dd04fc6ba47583c4f7e5f89 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 13:49:37 -0400 Subject: [PATCH 02/25] Fix invocation of deno validator --- .github/workflows/validate_datasets.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 9f6f60b5f..41999b799 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -70,11 +70,8 @@ jobs: run: | pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator - cd bids-validator/bids-validator - ./build.ts - ls -l dist/validator - # TODO: install properly somehow!! Yarik knows no "deno" - sudo ln -s $PWD/dist/validator /usr/bin/bids-validator + echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" >| /usr/local/bin/bids-validator + chmod a+x /usr/local/bin/bids-validator which -a bids-validator bids-validator --version bids-validator --help From f5c53f744f945b8128bc64f0f3eb883c11a4b2c7 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 14:06:14 -0400 Subject: [PATCH 03/25] Make it work with validator which does not support -c option --- run_tests.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 3e12d0df9..8d88ee5a5 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,13 @@ #!/usr/bin/env bash rc=0; + +if bids-validator --version | grep -q 'alpha$'; then + VALIDATOR_SUPPORTS_CONFIG=no +else + VALIDATOR_SUPPORTS_CONFIG=yes +fi + for i in $(ls -d */ | grep -v node_modules); do echo "Validating dataset" $i @@ -14,7 +21,7 @@ for i in $(ls -d */ | grep -v node_modules); do CMD="bids-validator ${i%%/} $VALIDATOR_ARGS" # Use default configuration unless overridden - if [ ! -f ${i%%/}/.bids-validator-config.json ]; then + if [ "$VALIDATOR_SUPPORTS_CONFIG" = "yes" ] && [ ! -f ${i%%/}/.bids-validator-config.json ]; then CMD="$CMD -c $PWD/bidsconfig.json" fi From 560bd03fb99b64f4a8bc5e0e96b365a9d1f0d3c9 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 19 Apr 2024 17:01:14 -0400 Subject: [PATCH 04/25] Support validation using new deno validator while manually skipping EMPTY_FILE errors. Also adjusted output to make it more concise and easier to identify what errors belong to etc --- run_tests.sh | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 8d88ee5a5..7d0f889dd 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -2,17 +2,18 @@ rc=0; -if bids-validator --version | grep -q 'alpha$'; then - VALIDATOR_SUPPORTS_CONFIG=no -else +which bids-validator +if bids-validator --help | grep -q -e '--config'; then VALIDATOR_SUPPORTS_CONFIG=yes +else + VALIDATOR_SUPPORTS_CONFIG= fi for i in $(ls -d */ | grep -v node_modules); do - echo "Validating dataset" $i + echo -n "Validating dataset $i: " if [ -f ${i%%/}/.SKIP_VALIDATION ]; then - echo "Skipping validation for ${i%%/}" + echo "skipping validation" continue fi @@ -21,18 +22,37 @@ for i in $(ls -d */ | grep -v node_modules); do CMD="bids-validator ${i%%/} $VALIDATOR_ARGS" # Use default configuration unless overridden - if [ "$VALIDATOR_SUPPORTS_CONFIG" = "yes" ] && [ ! -f ${i%%/}/.bids-validator-config.json ]; then - CMD="$CMD -c $PWD/bidsconfig.json" + if [ -n "$VALIDATOR_SUPPORTS_CONFIG" ]; then + if [ ! -f ${i%%/}/.bids-validator-config.json ]; then + CMD="$CMD -c $PWD/bidsconfig.json" + fi + else + # with new one we do not have config so let's get --json and exclude some using jq + CMD="$CMD --json" fi # Ignore NIfTI headers except for synthetic dataset if [ $i != "synthetic/" ]; then CMD="$CMD --ignoreNiftiHeaders" else - echo "Validating NIfTI headers for dataset" $i + echo "validating NIfTI headers. " fi - echo $CMD - $CMD || rc=$? + echo "Running " $CMD + + if [ -n "$VALIDATOR_SUPPORTS_CONFIG" ]; then + $CMD || rc=$? + else + # rc is not returned correctly anyways and for the best since we need to ignore + # ref: https://github.com/bids-standard/bids-validator/issues/1909 + # NOTE: limit to 1 file per error to not flood screen! + errors=$($CMD 2>/dev/null \ + | jq '(.issues | map(select(.severity == "error" and .key != "EMPTY_FILE"))) | map(.files_1 = (.files | if length > 0 then .[0:1] else empty end) | del(.files)) | if length > 0 then . else empty end' \ + ) + if [ -n "$errors" ]; then + echo -e "$errors" | sed -e 's,^, ,g' + rc=1 + fi + fi done exit $rc; From 4e428e85c3c463c6aeb9c905ce673bc12ab4fa80 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 19 Apr 2024 17:15:30 -0400 Subject: [PATCH 05/25] Do not bother storing/returning "last dataset rc" - best output which datasets failed, exit 1 if any --- run_tests.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 7d0f889dd..00ba3a2bd 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -rc=0; +failed= which bids-validator if bids-validator --help | grep -q -e '--config'; then @@ -41,9 +41,9 @@ for i in $(ls -d */ | grep -v node_modules); do echo "Running " $CMD if [ -n "$VALIDATOR_SUPPORTS_CONFIG" ]; then - $CMD || rc=$? + $CMD || failed+=" $i" else - # rc is not returned correctly anyways and for the best since we need to ignore + # exit code is not returned correctly anyways and for the best since we need to ignore # ref: https://github.com/bids-standard/bids-validator/issues/1909 # NOTE: limit to 1 file per error to not flood screen! errors=$($CMD 2>/dev/null \ @@ -51,8 +51,11 @@ for i in $(ls -d */ | grep -v node_modules); do ) if [ -n "$errors" ]; then echo -e "$errors" | sed -e 's,^, ,g' - rc=1 + failed+=" $i" fi fi done -exit $rc; +if [ -n "$failed" ]; then + echo "Datasets failed validation: $failed" + exit 1 +fi From 705bc1611effcb56496d77ef40a21ce627591256 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 25 Apr 2024 18:16:47 -0400 Subject: [PATCH 06/25] Mark known to fail ATM datsets to be skipped for master-deno validator --- .github/workflows/validate_datasets.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 41999b799..91df69139 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -100,6 +100,12 @@ jobs: fi shell: bash + - name: Mark to be skipped some examples for a deno based + if: "matrix.bids-validator == 'master-deno'" + run: | + touch {ds000117,ds000246,ds000247,ds000248,eeg_ds003645s_hed_demo,ieeg_motorMiller2007,ieeg_visual}/.SKIP_VALIDATION + shell: bash + - name: Validate all BIDS datasets using bids-validator run: | cat ./run_tests.sh From de9892f1187b6feb3e6bfed6f004a6cdfc8aaec9 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 26 Apr 2024 14:58:15 -0400 Subject: [PATCH 07/25] Use simplest sh form of redirect without | and space after before filename to hopefully become compatible with windows environment --- .github/workflows/validate_datasets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 91df69139..9dc8d4d9d 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -70,7 +70,7 @@ jobs: run: | pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator - echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" >| /usr/local/bin/bids-validator + echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" >/usr/local/bin/bids-validator chmod a+x /usr/local/bin/bids-validator which -a bids-validator bids-validator --version From 1c6068b40bcd2e34e3d7e64d95a66945df398a1f Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 09:49:21 -0400 Subject: [PATCH 08/25] Update .github/workflows/validate_datasets.yml --- .github/workflows/validate_datasets.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 9dc8d4d9d..a21bb04a8 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -68,6 +68,7 @@ jobs: - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" run: | + env pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" >/usr/local/bin/bids-validator @@ -76,6 +77,7 @@ jobs: bids-validator --version bids-validator --help popd + shell: bash - name: Display versions and environment information run: | From 101d22dd9c14a76229320fad48342da55e50cabc Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:02:32 -0400 Subject: [PATCH 09/25] CI: Set default shell to bash, disable node for deno test --- .github/workflows/validate_datasets.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index a21bb04a8..7b8b8bf08 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -15,6 +15,10 @@ concurrency: group: ${{ github.ref }} cancel-in-progress: true +defaults: + run: + shell: bash + jobs: build: strategy: @@ -33,6 +37,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Node.js + if: "matrix.bids-validator == 'stable' || matrix.bids-validator == 'master'" uses: actions/setup-node@v4 with: node-version: 18 @@ -77,7 +82,6 @@ jobs: bids-validator --version bids-validator --help popd - shell: bash - name: Display versions and environment information run: | @@ -100,16 +104,13 @@ jobs: echo "$found" exit 1; fi - shell: bash - name: Mark to be skipped some examples for a deno based if: "matrix.bids-validator == 'master-deno'" run: | touch {ds000117,ds000246,ds000247,ds000248,eeg_ds003645s_hed_demo,ieeg_motorMiller2007,ieeg_visual}/.SKIP_VALIDATION - shell: bash - name: Validate all BIDS datasets using bids-validator run: | cat ./run_tests.sh ./run_tests.sh - shell: bash From 213006057e24204971ab56c07bf4e24fb6917295 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:08:47 -0400 Subject: [PATCH 10/25] ENH: Create deno-based validator in /usr/local/bin --- .github/workflows/validate_datasets.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 7b8b8bf08..bef1f6afc 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -36,6 +36,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Ensure /usr/local/bin is in the PATH + run: | + mkdir -p /usr/local/bin + echo PATH="/usr/local/bin:$PATH" >> $GITHUB_ENV + - name: Set up Node.js if: "matrix.bids-validator == 'stable' || matrix.bids-validator == 'master'" uses: actions/setup-node@v4 @@ -73,10 +78,13 @@ jobs: - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" run: | - env pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator - echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" >/usr/local/bin/bids-validator + cat >> /usr/local/bin/bids-validator < Date: Mon, 29 Apr 2024 10:10:55 -0400 Subject: [PATCH 11/25] Use bare env, set debug --- .github/workflows/validate_datasets.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index bef1f6afc..bc1157585 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -78,10 +78,11 @@ jobs: - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" run: | + set -x pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator cat >> /usr/local/bin/bids-validator < Date: Mon, 29 Apr 2024 10:13:28 -0400 Subject: [PATCH 12/25] Fix cat call --- .github/workflows/validate_datasets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index bc1157585..e9ac75d5a 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -81,7 +81,7 @@ jobs: set -x pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator - cat >> /usr/local/bin/bids-validator < /usr/local/bin/bids-validator \#\!env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run import $PWD/bids-validator/bids-validator/src/bids-validator.ts END From aca5e7139def9c386d2f7e015749b304529729d5 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:16:18 -0400 Subject: [PATCH 13/25] Give up on cat --- .github/workflows/validate_datasets.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index e9ac75d5a..5b3680a11 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -81,12 +81,11 @@ jobs: set -x pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator - cat < /usr/local/bin/bids-validator - \#\!env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run - import $PWD/bids-validator/bids-validator/src/bids-validator.ts - END - cat /usr/local/bin/bids-validator - chmod a+x /usr/local/bin/bids-validator + VALIDATOR=/usr/local/bin/bids-validator + echo "#!env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run" > $VALIDATOR + echo "import $PWD/bids-validator/bids-validator/src/bids-validator.ts" >> $VALIDATOR + cat $VALIDATOR + chmod a+x $VALIDATOR which -a bids-validator bids-validator --version bids-validator --help From 4a0ec5e7eb9e6a5526bb781f6b435e9537e6bddc Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:17:47 -0400 Subject: [PATCH 14/25] Try /usr/bin/env --- .github/workflows/validate_datasets.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 5b3680a11..80858b077 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -80,9 +80,10 @@ jobs: run: | set -x pushd .. + which /usr/bin/env git clone --depth 1 https://github.com/bids-standard/bids-validator VALIDATOR=/usr/local/bin/bids-validator - echo "#!env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run" > $VALIDATOR + echo "#!/usr/bin/env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run" > $VALIDATOR echo "import $PWD/bids-validator/bids-validator/src/bids-validator.ts" >> $VALIDATOR cat $VALIDATOR chmod a+x $VALIDATOR From 0ec7d33233008ca31ab4db242fdfa8f1bef055a9 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:21:18 -0400 Subject: [PATCH 15/25] Revert to lots of indirection --- .github/workflows/validate_datasets.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 80858b077..9d9b8c736 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -83,8 +83,7 @@ jobs: which /usr/bin/env git clone --depth 1 https://github.com/bids-standard/bids-validator VALIDATOR=/usr/local/bin/bids-validator - echo "#!/usr/bin/env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run" > $VALIDATOR - echo "import $PWD/bids-validator/bids-validator/src/bids-validator.ts" >> $VALIDATOR + echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" > $VALIDATOR cat $VALIDATOR chmod a+x $VALIDATOR which -a bids-validator From 71645cc39163d54fb1c539a0388b1b418a7c3c83 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:27:10 -0400 Subject: [PATCH 16/25] Deno needs to be installed with powershell on Windows --- .github/workflows/validate_datasets.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 9d9b8c736..15d46f95b 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -74,6 +74,7 @@ jobs: if: "matrix.bids-validator == 'master-deno'" with: deno-version: v1.x + shell: ${{ matrix.platform == 'windows-latest' && 'powershell' || 'bash' }} - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" From fdfe0b542153c5caae917800e6a21a20a0688eca Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:30:26 -0400 Subject: [PATCH 17/25] Set shell step-by-step --- .github/workflows/validate_datasets.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 15d46f95b..6d56de3dd 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -15,10 +15,6 @@ concurrency: group: ${{ github.ref }} cancel-in-progress: true -defaults: - run: - shell: bash - jobs: build: strategy: @@ -40,6 +36,7 @@ jobs: run: | mkdir -p /usr/local/bin echo PATH="/usr/local/bin:$PATH" >> $GITHUB_ENV + shell: bash - name: Set up Node.js if: "matrix.bids-validator == 'stable' || matrix.bids-validator == 'master'" @@ -74,7 +71,6 @@ jobs: if: "matrix.bids-validator == 'master-deno'" with: deno-version: v1.x - shell: ${{ matrix.platform == 'windows-latest' && 'powershell' || 'bash' }} - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" @@ -91,6 +87,7 @@ jobs: bids-validator --version bids-validator --help popd + shell: bash - name: Display versions and environment information run: | @@ -113,13 +110,16 @@ jobs: echo "$found" exit 1; fi + shell: bash - name: Mark to be skipped some examples for a deno based if: "matrix.bids-validator == 'master-deno'" run: | touch {ds000117,ds000246,ds000247,ds000248,eeg_ds003645s_hed_demo,ieeg_motorMiller2007,ieeg_visual}/.SKIP_VALIDATION + shell: bash - name: Validate all BIDS datasets using bids-validator run: | cat ./run_tests.sh ./run_tests.sh + shell: bash From 14343344c882a2bc769c50a3a48a250a1f229f90 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 29 Apr 2024 10:32:06 -0400 Subject: [PATCH 18/25] Maybe we killed powershell with our unix path? --- .github/workflows/validate_datasets.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 6d56de3dd..9c68e5b2c 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -32,12 +32,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Ensure /usr/local/bin is in the PATH - run: | - mkdir -p /usr/local/bin - echo PATH="/usr/local/bin:$PATH" >> $GITHUB_ENV - shell: bash - - name: Set up Node.js if: "matrix.bids-validator == 'stable' || matrix.bids-validator == 'master'" uses: actions/setup-node@v4 @@ -72,6 +66,12 @@ jobs: with: deno-version: v1.x + - name: Ensure /usr/local/bin is in the PATH + run: | + mkdir -p /usr/local/bin + echo PATH="/usr/local/bin:$PATH" >> $GITHUB_ENV + shell: bash + - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" run: | @@ -96,6 +96,7 @@ jobs: echo "npm"; npm --version echo "node"; node --version echo "bids-validator"; bids-validator --version + shell: bash - name: Check that no large files are present if: "matrix.bids-validator == 'stable'" From fd0ae0de608960017539f50003e4379c7860df4a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 29 Apr 2024 16:03:25 -0400 Subject: [PATCH 19/25] RF: just install deno validator into /usr/bin It is just CI. Then we can avoid messing around with PATH for Windows --- .github/workflows/validate_datasets.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 9c68e5b2c..0a7150c5d 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -66,20 +66,13 @@ jobs: with: deno-version: v1.x - - name: Ensure /usr/local/bin is in the PATH - run: | - mkdir -p /usr/local/bin - echo PATH="/usr/local/bin:$PATH" >> $GITHUB_ENV - shell: bash - - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" run: | set -x pushd .. - which /usr/bin/env git clone --depth 1 https://github.com/bids-standard/bids-validator - VALIDATOR=/usr/local/bin/bids-validator + VALIDATOR=/usr/bin/bids-validator echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" > $VALIDATOR cat $VALIDATOR chmod a+x $VALIDATOR From 3269e7be3008f80e842710d2a80f5b282871064d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 4 Jun 2024 12:01:54 -0400 Subject: [PATCH 20/25] Try to sudo to create and tune the file --- .github/workflows/validate_datasets.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 0a7150c5d..6b7454571 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -73,9 +73,9 @@ jobs: pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator VALIDATOR=/usr/bin/bids-validator - echo -e '#!/bin/sh\n'"$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" > $VALIDATOR + sudo bash -c 'echo -e "#!/bin/sh\n""$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" > /usr/bin/bids-validator' cat $VALIDATOR - chmod a+x $VALIDATOR + sudo chmod a+rx $VALIDATOR which -a bids-validator bids-validator --version bids-validator --help From 78644eb4bb04f0fb51b1b9bef6da2b79da9d4b3c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 5 Jun 2024 13:59:58 -0400 Subject: [PATCH 21/25] Show PATH -- may be we could install to some other locations on mac/windows... --- .github/workflows/validate_datasets.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 6b7454571..5524ace52 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -72,6 +72,8 @@ jobs: set -x pushd .. git clone --depth 1 https://github.com/bids-standard/bids-validator + # For debugging purposes + echo "PATH=$PATH" VALIDATOR=/usr/bin/bids-validator sudo bash -c 'echo -e "#!/bin/sh\n""$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" > /usr/bin/bids-validator' cat $VALIDATOR From fdb0cacc65cdb5e2adc11d64bff675011880d97b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 5 Jun 2024 15:07:53 -0400 Subject: [PATCH 22/25] Try effigies way to install the beast Co-authored-by: Chris Markiewicz --- .github/workflows/validate_datasets.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 5524ace52..62c2eaf74 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -70,18 +70,19 @@ jobs: if: "matrix.bids-validator == 'master-deno'" run: | set -x - pushd .. - git clone --depth 1 https://github.com/bids-standard/bids-validator + LOCAL_BIN=$HOME/.local/bin + VALIDATOR=$LOCAL_BIN/bids-validator + echo $VALIDATOR # debug + mkdir -p $LOCAL_BIN + export PATH="$LOCAL_BIN:$PATH" + echo PATH="$PATH" | tee -a $GITHUB_ENV + echo -e '#!/bin/env'" -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run\nimport 'https://github.com/bids-standard/bids-validator/raw/master/bids-validator/src/bids-validator.ts'" > $VALIDATOR + chmod +x $VALIDATOR # For debugging purposes - echo "PATH=$PATH" - VALIDATOR=/usr/bin/bids-validator - sudo bash -c 'echo -e "#!/bin/sh\n""$PWD/bids-validator/bids-validator/bids-validator-deno \"\$@\"" > /usr/bin/bids-validator' cat $VALIDATOR - sudo chmod a+rx $VALIDATOR which -a bids-validator bids-validator --version bids-validator --help - popd shell: bash - name: Display versions and environment information From 953963ebfbe497b9b9c1325501ec2bebafa249cf Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 5 Jun 2024 15:22:38 -0400 Subject: [PATCH 23/25] Update .github/workflows/validate_datasets.yml --- .github/workflows/validate_datasets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 62c2eaf74..c05f14106 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -76,7 +76,7 @@ jobs: mkdir -p $LOCAL_BIN export PATH="$LOCAL_BIN:$PATH" echo PATH="$PATH" | tee -a $GITHUB_ENV - echo -e '#!/bin/env'" -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run\nimport 'https://github.com/bids-standard/bids-validator/raw/master/bids-validator/src/bids-validator.ts'" > $VALIDATOR + echo -e '#!/usr/bin/env'" -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run\nimport 'https://github.com/bids-standard/bids-validator/raw/master/bids-validator/src/bids-validator.ts'" > $VALIDATOR chmod +x $VALIDATOR # For debugging purposes cat $VALIDATOR From c1f2b5f67079a119752156ec303b1a9ab8d73e25 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 5 Jun 2024 16:51:41 -0400 Subject: [PATCH 24/25] Relax versioning req and remove debug statements Co-authored-by: Chris Markiewicz --- .github/workflows/validate_datasets.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index c05f14106..05ed9e3d9 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -61,7 +61,7 @@ jobs: bash -c "npm install -g bids-validator-*.tgz" popd - - uses: denoland/setup-deno@v1.1.2 + - uses: denoland/setup-deno@v1 if: "matrix.bids-validator == 'master-deno'" with: deno-version: v1.x @@ -69,20 +69,14 @@ jobs: - name: Install BIDS validator (master deno build) if: "matrix.bids-validator == 'master-deno'" run: | - set -x LOCAL_BIN=$HOME/.local/bin VALIDATOR=$LOCAL_BIN/bids-validator - echo $VALIDATOR # debug mkdir -p $LOCAL_BIN export PATH="$LOCAL_BIN:$PATH" - echo PATH="$PATH" | tee -a $GITHUB_ENV + echo PATH="$PATH" >> $GITHUB_ENV echo -e '#!/usr/bin/env'" -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run\nimport 'https://github.com/bids-standard/bids-validator/raw/master/bids-validator/src/bids-validator.ts'" > $VALIDATOR chmod +x $VALIDATOR - # For debugging purposes - cat $VALIDATOR - which -a bids-validator bids-validator --version - bids-validator --help shell: bash - name: Display versions and environment information From 4e04a68f81da10a9d6582184982fea3c04b2cfab Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 6 Jun 2024 11:12:50 -0400 Subject: [PATCH 25/25] Skip more datasets for now to get into green --- .github/workflows/validate_datasets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_datasets.yml b/.github/workflows/validate_datasets.yml index 05ed9e3d9..0bc1f3df9 100644 --- a/.github/workflows/validate_datasets.yml +++ b/.github/workflows/validate_datasets.yml @@ -106,7 +106,7 @@ jobs: - name: Mark to be skipped some examples for a deno based if: "matrix.bids-validator == 'master-deno'" run: | - touch {ds000117,ds000246,ds000247,ds000248,eeg_ds003645s_hed_demo,ieeg_motorMiller2007,ieeg_visual}/.SKIP_VALIDATION + touch {ds000117,ds000246,ds000247,ds000248,eeg_ds003645s_hed_demo,ieeg_motorMiller2007,ieeg_visual,7t_trt,ds102,fnirs_automaticity,genetics_ukbb,ieeg_epilepsy,ieeg_epilepsyNWB}/.SKIP_VALIDATION shell: bash - name: Validate all BIDS datasets using bids-validator