Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v3 #321

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 107 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,128 @@
name: Test
"on":
name: CI
on:
workflow_dispatch:
push:
branches:
- main
- dependabot/npm_and_yarn/**
pull_request:
types:
- opened
- synchronize

permissions:
contents: read

jobs:
test_matrix:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Dependency review
uses: actions/dependency-review-action@v4

license-check:
name: Check Licenses
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Check Licenses
run: npx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;Apache 2.0;Python-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT"

codeql:
name: CodeQL
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:javascript-typescript"

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint

test-unit:
name: Test on Node ${{ matrix.node-version }} and ${{ matrix.os }}
strategy:
matrix:
node_version:
- 10
- 12
- 14
- 16
node-version:
- 18
- 20
- 22
os:
- ubuntu-latest
- macos-latest
- windows-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npx tap 'test/*.js'
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test

test:
runs-on: ubuntu-latest
needs: test_matrix
needs:
- test-unit
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
node-version: 16
- run: npm ci
- run: npm run lint
- run: exit 1
if: ${{ needs.test-unit.result != 'success' }}
- run: exit 0
if: ${{ needs.test-unit.result == 'success' }}
if: ${{ always() }}
7 changes: 7 additions & 0 deletions .taprc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
files:
- test/**/*.test.js

lines: 91
functions: 100
branches: 83
statements: 91
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = { getTransformStream };

const { Transform } = require("readable-stream");
const { Transform } = require("node:stream");

const prettyFactory = require("pino-pretty");
const Sentry = require("@sentry/node");
Expand Down
Loading
Loading