-
Notifications
You must be signed in to change notification settings - Fork 135
110 lines (96 loc) · 3.02 KB
/
validate_datasets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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: [master, stable, master-deno]
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 == 'stable' || matrix.bids-validator == 'master'"
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@v1
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: |
LOCAL_BIN=$HOME/.local/bin
VALIDATOR=$LOCAL_BIN/bids-validator
mkdir -p $LOCAL_BIN
export PATH="$LOCAL_BIN:$PATH"
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
bids-validator --version
shell: bash
- name: Display versions and environment information
run: |
echo $TZ
date
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'"
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: Validate all BIDS datasets using bids-validator
run: |
cat ./run_tests.sh
./run_tests.sh
shell: bash