Skip to content

Commit

Permalink
chore: use vitest v8 coverage provider and enable coverage (#417)
Browse files Browse the repository at this point in the history
* chore: run linting in spearate job, use v8 instead of c8, enable coverage

* chore: minimum is deno 1.32 which handles `node:` prefix

* chore: use deno 1.32.5 as latest because of security issues in 1.32.0
  • Loading branch information
danez committed Jul 12, 2023
1 parent 34b4787 commit 140b46d
Show file tree
Hide file tree
Showing 4 changed files with 821 additions and 1,114 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,44 @@ on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Linting
run: npm run format:ci
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [14.18.0, '*']
exclude:
os: [ubuntu-latest]
node-version: ['14.18.0', '*']
# Must include the minimum deno version from the `DENO_VERSION_RANGE` constant in `node/bridge.ts`.
deno-version: ['v1.32.5', 'v1.x']
include:
- os: macOS-latest
node-version: 14.18.0
node-version: '*'
deno-version: 'v1.x'
- os: windows-latest
node-version: 14.18.0
node-version: '*'
deno-version: 'v1.x'
fail-fast: false
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
# Should match the `DENO_VERSION_RANGE` constant in `node/bridge.ts`.
deno-version: v1.30.0
deno-version: ${{ matrix.deno-version }}
- name: Setup Deno dependencies
run: deno cache https://deno.land/x/eszip@v0.40.0/eszip.ts
- name: Node.js ${{ matrix.node-version }}
Expand All @@ -38,16 +55,13 @@ jobs:
check-latest: true
- name: Install dependencies
run: npm ci
- name: Linting
run: npm run format:ci
if: "${{ matrix.node-version == '*' }}"
- name: Tests
run: npm run test:ci
- name: Get test coverage flags
id: test-coverage-flags
run: |-
os=${{ matrix.os }}
node=${{ matrix.node-version }}
node=$(node --version)
echo "os=${os/-latest/}" >> $GITHUB_OUTPUT
echo "node=node_${node//[.*]/}" >> $GITHUB_OUTPUT
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion node/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getBinaryExtension } from './platform.js'
const DENO_VERSION_FILE = 'version.txt'
// When updating DENO_VERSION_RANGE, ensure that the deno version installed in the
// build-image/buildbot does satisfy this range!
const DENO_VERSION_RANGE = '^1.30.0'
const DENO_VERSION_RANGE = '^1.32.5'

type OnBeforeDownloadHook = () => void | Promise<void>
type OnAfterDownloadHook = (error?: Error) => void | Promise<void>
Expand Down

0 comments on commit 140b46d

Please sign in to comment.