Skip to content

Commit

Permalink
CI: Test stable (deno), dev (deno) and legacy (node)
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 5, 2024
1 parent 7de1e8c commit 5f3575d
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/validate_datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
bids-validator: [master, stable, master-deno]
bids-validator: [stable, dev, legacy]

runs-on: ${{ matrix.platform }}

Expand All @@ -33,53 +33,42 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Node.js
if: "matrix.bids-validator == 'stable' || matrix.bids-validator == 'master'"
if: matrix.bids-validator == 'legacy'
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install BIDS validator (stable)
if: "matrix.bids-validator == 'stable'"
run: |
npm install -g bids-validator
- name: Install BIDS validator (master)
if: "matrix.bids-validator == 'master'"
run: |
pushd ..
# Get npm 7+
npm install -g npm
git clone --depth 1 https://github.com/bids-standard/bids-validator
cd bids-validator
# Generate the full development node_modules
npm clean-install
# Build & bundle the bids-validator CLI package
npm -w bids-validator run build
# Generate a package to install globally
npm -w bids-validator pack
# Install the package globally
bash -c "npm install -g bids-validator-*.tgz"
popd
- uses: denoland/setup-deno@v2
if: "matrix.bids-validator == 'master-deno'"
if: matrix.bids-validator != 'legacy'
with:
deno-version: v1.x
deno-version: v2.x

- name: Install BIDS validator (master deno build)
if: "matrix.bids-validator == 'master-deno'"
- 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 (dev)
if: matrix.bids-validator == 'dev'
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 (legacy)
if: "matrix.bids-validator == 'legacy'"
run: |
npm install -g bids-validator
- name: Display versions and environment information
run: |
echo $TZ
date
echo "npm"; npm --version
echo "node"; node --version
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

Expand All @@ -100,7 +89,7 @@ jobs:

- name: Skip MRS validation for legacy validator
run: for DS in mrs_* dwi_deriv; do touch $DS/.SKIP_VALIDATION; done
if: "matrix.bids-validator != 'master-deno'"
if: matrix.bids-validator == 'legacy'
shell: bash

- name: Validate all BIDS datasets using bids-validator
Expand Down

0 comments on commit 5f3575d

Please sign in to comment.