From eb205a72d468441b6e03afdbc8e2d90df6f243a8 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 26 Aug 2024 14:55:08 -0400 Subject: [PATCH 1/3] chore(ci): Run Deno tests with/without network access --- .github/workflows/deno_tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deno_tests.yml b/.github/workflows/deno_tests.yml index 4f10a3314..0dc8eea91 100644 --- a/.github/workflows/deno_tests.yml +++ b/.github/workflows/deno_tests.yml @@ -39,10 +39,12 @@ jobs: strategy: matrix: os: [ubuntu-22.04, macos-12, windows-2022] + allow-net: [true, false] fail-fast: false defaults: run: working-directory: ./bids-validator + shell: bash steps: - uses: actions/checkout@v4 @@ -51,7 +53,13 @@ jobs: - uses: denoland/setup-deno@v1 with: deno-version: v1.x - - run: deno test --allow-all --coverage=cov/ src/ + - name: Set permissions with network access + run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --allow-net' >> $GITHUB_ENV + if: ${{ matrix.allow-net }} + - name: Set permissions without network access + run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --deny-net' >> $GITHUB_ENV + if: ${{ ! matrix.allow-net }} + - run: deno test $PERMS --coverage=cov/ src/ - name: Collect coverage run: deno coverage cov/ --lcov --output=coverage.lcov if: ${{ always() }} From 3931b30c3fbb3cdfbc02d3a8ae83098f245fb2de Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 26 Aug 2024 14:59:24 -0400 Subject: [PATCH 2/3] fix: Import schema correctly from JSR --- bids-validator/src/setup/loadSchema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids-validator/src/setup/loadSchema.ts b/bids-validator/src/setup/loadSchema.ts index 50a9c8a02..49439d74f 100644 --- a/bids-validator/src/setup/loadSchema.ts +++ b/bids-validator/src/setup/loadSchema.ts @@ -1,6 +1,6 @@ import type { Schema } from '../types/schema.ts' import { objectPathHandler } from '../utils/objectPathHandler.ts' -import * as schemaDefault from '@bids/schema/schema' with { type: 'json' } +import default as schemaDefault from '@bids/schema/schema' with { type: 'json' } import { setCustomMetadataFormats } from '../validators/json.ts' /** From 2c7239fd70e3750557004b3445adb22e496ad4a6 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 26 Aug 2024 15:27:13 -0400 Subject: [PATCH 3/3] Update bids-validator/src/setup/loadSchema.ts Co-authored-by: Ross Blair --- bids-validator/src/setup/loadSchema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids-validator/src/setup/loadSchema.ts b/bids-validator/src/setup/loadSchema.ts index 49439d74f..3c8a5ba06 100644 --- a/bids-validator/src/setup/loadSchema.ts +++ b/bids-validator/src/setup/loadSchema.ts @@ -1,6 +1,6 @@ import type { Schema } from '../types/schema.ts' import { objectPathHandler } from '../utils/objectPathHandler.ts' -import default as schemaDefault from '@bids/schema/schema' with { type: 'json' } +import { default as schemaDefault } from '@bids/schema/schema' with { type: 'json' } import { setCustomMetadataFormats } from '../validators/json.ts' /**