Skip to content

Commit 7f69dec

Browse files
authored
Merge pull request #1 from bids-standard/fix/deno_2_test_and_build
Fix/deno 2 test and build
2 parents fbd9129 + 346ae58 commit 7f69dec

File tree

22 files changed

+976
-565
lines changed

22 files changed

+976
-565
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
tests
2-
.git
32
node_modules

.github/workflows/deno_tests.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
- name: Save describe stamp
2323
id: describe
2424
run: echo version=$( git describe ) >> $GITHUB_OUTPUT
25-
- uses: denoland/setup-deno@v1
25+
- uses: denoland/setup-deno@v2
2626
with:
27-
deno-version: v1.x
28-
- run: ./build.ts
27+
deno-version: v2.x
28+
- run: deno --node-modules-dir=auto -A ./build.ts
2929
working-directory: ./bids-validator
3030
- run: deno run -A ./bids-validator/dist/validator/bids-validator.js --version
3131
- uses: actions/upload-artifact@v4
@@ -52,14 +52,17 @@ jobs:
5252
submodules: true
5353
- uses: denoland/setup-deno@v1
5454
with:
55-
deno-version: v1.x
55+
deno-version: v2.x
5656
- name: Set permissions with network access
5757
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --allow-net' >> $GITHUB_ENV
5858
if: ${{ matrix.allow-net }}
5959
- name: Set permissions without network access
6060
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --deny-net' >> $GITHUB_ENV
6161
if: ${{ ! matrix.allow-net }}
62-
- run: deno test $PERMS --coverage=cov/ src/
62+
- name: Disable example that requires network access
63+
run: touch tests/data/bids-examples/xeeg_hed_score/.SKIP_VALIDATION
64+
if: ${{ ! matrix.allow-net }}
65+
- run: deno test --node-modules-dir=auto $PERMS --coverage=cov/ src/
6366
- name: Collect coverage
6467
run: deno coverage cov/ --lcov --output=coverage.lcov
6568
if: ${{ always() }}

.github/workflows/schema_web_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
20-
- uses: denoland/setup-deno@v1
20+
- uses: denoland/setup-deno@v2
2121
with:
22-
deno-version: v1.x
22+
deno-version: v2.x
2323
- run: deno task build
2424
working-directory: ./web
2525
- uses: actions/upload-artifact@v4

.github/workflows/schema_web_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v4
1717
- uses: denoland/setup-deno@v1
1818
with:
19-
deno-version: v1.x
19+
deno-version: v2.x
2020
- run: deno task build
2121
working-directory: ./web
2222
- name: Install NPM deps

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ coverage/
1111
__pycache__/
1212
dist/
1313
*.egg-info/
14-
bids-validator-web/out/
1514
.next/
1615

1716
# Only use global yarn.lock

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ARG BASE_IMAGE=denoland/deno:2.0.1
2+
FROM ${BASE_IMAGE} AS build
3+
WORKDIR /src
4+
5+
RUN apt-get update && \
6+
apt-get install -y git jq && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/*
9+
10+
ADD . .
11+
RUN export VERSION=`git -C . -c safe.directory=* describe --tags --always` && \
12+
jq -r ".version|=\"$VERSION\"" bids-validator/deno.json > ._deno.json
13+
14+
WORKDIR /src/bids-validator
15+
RUN deno cache ./bids-validator-deno
16+
RUN ./build.ts
17+
18+
FROM ${BASE_IMAGE} AS base
19+
WORKDIR /src
20+
COPY . .
21+
COPY --from=build /src/._deno.json /src/bids-validator/deno.json
22+
WORKDIR /src/bids-validator
23+
RUN deno cache ./bids-validator-deno
24+
ENTRYPOINT ["./bids-validator-deno"]
25+
26+
FROM ${BASE_IMAGE} AS min
27+
WORKDIR /src
28+
COPY --from=build /src/bids-validator/dist/validator/* .
29+
30+
ENTRYPOINT ["deno", "-A", "./bids-validator.js"]

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 438 additions & 0 deletions
Large diffs are not rendered by default.

bids-validator/README.md

Lines changed: 41 additions & 413 deletions
Large diffs are not rendered by default.

bids-validator/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
import * as esbuild from 'https://deno.land/x/[email protected]/mod.js'
88
import { parse } from 'https://deno.land/[email protected]/flags/mod.ts'
9-
import { denoPlugins } from "jsr:@luca/esbuild-deno-loader@0.10.3"
9+
import { denoPlugins } from "jsr:@luca/esbuild-deno-loader@0.11.0"
1010
import * as path from "https://deno.land/[email protected]/path/mod.ts"
1111
import { getVersion } from './src/version.ts'
1212

0 commit comments

Comments
 (0)