-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add APIs to easily test the Pino logger (#1)
* feat: add APIs to easily test the Pino logger * chore: apply suggested changes
- Loading branch information
1 parent
cfc7097
commit afbb0ff
Showing
17 changed files
with
961 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pino-test.d.ts | ||
test/types/pino-test.test-d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": [ | ||
"standard" | ||
], | ||
"rules": { | ||
"no-var": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '*.md' | ||
pull_request: | ||
paths-ignore: | ||
- '*.md' | ||
|
||
# This allows a subsequently queued workflow run to interrupt previous runs | ||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
dependency-review: | ||
name: Dependency Review | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Dependency review | ||
uses: actions/dependency-review-action@v3 | ||
|
||
test: | ||
name: ${{ matrix.node-version }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: read | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macOS-latest, windows-latest, ubuntu-latest] | ||
node-version: [18, 19, 20, 21] | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install dependencies | ||
run: npm i --ignore-scripts | ||
|
||
- name: Run tests | ||
run: npm run test-ci | ||
|
||
automerge: | ||
name: Automerge Dependabot PRs | ||
if: > | ||
github.event_name == 'pull_request' && | ||
github.event.pull_request.user.login == 'dependabot[bot]' | ||
needs: test | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: fastify/github-action-merge-dependabot@v3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Lock Threads' | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: lock | ||
|
||
jobs: | ||
action: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: jsumners/lock-threads@b27edac0ac998d42b2815e122b6c24b32b568321 | ||
with: | ||
log-output: true | ||
issue-inactive-days: '30' | ||
issue-comment: > | ||
This issue has been automatically locked since there | ||
has not been any recent activity after it was closed. | ||
Please open a new issue for related bugs. | ||
pr-comment: > | ||
This pull request has been automatically locked since there | ||
has not been any recent activity after it was closed. | ||
Please open a new issue for related bugs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: package-manager-ci | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- package-manager-load | ||
permissions: | ||
contents: read | ||
jobs: | ||
pnpm: | ||
name: pnpm package manager on ${{ matrix.node-version }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
node-version: [20] | ||
steps: | ||
- 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 }} | ||
- name: Use pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ^8.0.0 | ||
- name: Install dependancies | ||
run: pnpm install | ||
- name: Tests | ||
run: pnpm run test-ci-pnpm | ||
|
||
yarn: | ||
name: yarn package manager on ${{ matrix.node-version }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
node-version: [20] | ||
steps: | ||
- 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 }} | ||
- name: Use yarn | ||
run: | | ||
yarn set version berry && yarn set version 2 | ||
echo "nodeLinker: node-modules" >> .yarnrc.yml | ||
# see https://github.com/yarnpkg/berry/issues/2935#issuecomment-911299992 | ||
yarn add --dev typescript@~4.3.2 | ||
yarn install | ||
env: | ||
# needed due the yarn.lock file in pino's .gitignore | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: false | ||
- name: Tests | ||
run: yarn run test-ci | ||
|
||
yarn-pnp: | ||
name: yarn-pnp package manager on ${{ matrix.node-version }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
node-version: [20] | ||
steps: | ||
- 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 }} | ||
- name: Use yarn | ||
run: | | ||
yarn set version berry | ||
echo 'nodeLinker: pnp | ||
packageExtensions: | ||
debug@*: | ||
dependencies: | ||
supports-color: "*" | ||
treport@*: | ||
dependencies: | ||
tap-yaml: "*" | ||
' >> .yarnrc.yml | ||
yarn add --dev typescript@~5.4.2 | ||
yarn install | ||
- name: Tests | ||
run: yarn run test-ci-yarn-pnp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: PR Target Check | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened] | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
comment: | ||
if: ${{ github.base_ref != "master" }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: '⚠️ This pull request does not target the master branch.' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
Oops, something went wrong.