Skip to content

Commit eb205a7

Browse files
committed
chore(ci): Run Deno tests with/without network access
1 parent b005d9d commit eb205a7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/deno_tests.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ jobs:
3939
strategy:
4040
matrix:
4141
os: [ubuntu-22.04, macos-12, windows-2022]
42+
allow-net: [true, false]
4243
fail-fast: false
4344
defaults:
4445
run:
4546
working-directory: ./bids-validator
47+
shell: bash
4648

4749
steps:
4850
- uses: actions/checkout@v4
@@ -51,7 +53,13 @@ jobs:
5153
- uses: denoland/setup-deno@v1
5254
with:
5355
deno-version: v1.x
54-
- run: deno test --allow-all --coverage=cov/ src/
56+
- name: Set permissions with network access
57+
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --allow-net' >> $GITHUB_ENV
58+
if: ${{ matrix.allow-net }}
59+
- name: Set permissions without network access
60+
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --deny-net' >> $GITHUB_ENV
61+
if: ${{ ! matrix.allow-net }}
62+
- run: deno test $PERMS --coverage=cov/ src/
5563
- name: Collect coverage
5664
run: deno coverage cov/ --lcov --output=coverage.lcov
5765
if: ${{ always() }}

0 commit comments

Comments
 (0)