Skip to content

Commit

Permalink
chore(ci): Run Deno tests with/without network access
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Aug 26, 2024
1 parent b005d9d commit d5f4c42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/deno_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-2022]
allow-net: [true, false]
fail-fast: false
defaults:
run:
Expand All @@ -51,7 +52,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-env --allow-run --allow-net"' >> $GITHUB_ENV
if: ${{ matrix.allow-net }}
- name: Set permissions without network access
run: echo 'PERMS="--allow-read --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() }}
Expand Down

0 comments on commit d5f4c42

Please sign in to comment.