Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Test stable (deno), dev (deno) and legacy (node) #470

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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