Skip to content

Commit

Permalink
Merge branch 'main' into (fastify#4439)-Access-handler-name-add-prope…
Browse files Browse the repository at this point in the history
…rties-to-req-route-options
  • Loading branch information
Uzlopak committed Aug 6, 2023
2 parents 3a64cef + 298adbc commit 5eb061b
Show file tree
Hide file tree
Showing 112 changed files with 6,600 additions and 1,772 deletions.
8 changes: 8 additions & 0 deletions .c8rc.json
@@ -0,0 +1,8 @@
{
"exclude": [
"lib/configValidator.js",
"lib/error-serializer.js",
"build/build-error-serializer.js",
"test/*"
]
}
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Expand Up @@ -2,12 +2,18 @@ version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
commit-message:
# Prefix all commit messages with "chore: "
prefix: "chore"
schedule:
interval: "monthly"
open-pull-requests-limit: 10

- package-ecosystem: "npm"
directory: "/"
commit-message:
# Prefix all commit messages with "chore: "
prefix: "chore"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
28 changes: 22 additions & 6 deletions .github/workflows/benchmark-parser.yml
Expand Up @@ -40,7 +40,9 @@ jobs:
run: |
npm run --silent benchmark:parser > ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
echo 'BENCH_RESULT${{matrix.node-version}}<<EOF' >> $GITHUB_OUTPUT
echo "$result" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
# main benchmark
- uses: actions/checkout@v3
Expand All @@ -57,7 +59,9 @@ jobs:
run: |
npm run --silent benchmark:parser > ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
echo 'BENCH_RESULT${{matrix.node-version}}<<EOF' >> $GITHUB_OUTPUT
echo "$result" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
output-benchmark:
needs: [benchmark]
Expand Down Expand Up @@ -89,8 +93,20 @@ jobs:
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-18 }}
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-18 }}
- uses: actions-ecosystem/action-remove-labels@v1
remove-label:
if: "always()"
needs:
- benchmark
- output-benchmark
runs-on: ubuntu-latest
steps:
- name: Remove benchmark label
uses: octokit/request-action@v2.x
id: remove-label
with:
labels: |
benchmark
github_token: ${{ secrets.GITHUB_TOKEN }}
route: DELETE /repos/{repo}/issues/{issue_number}/labels/{name}
repo: ${{ github.event.pull_request.head.repo.full_name }}
issue_number: ${{ github.event.pull_request.number }}
name: benchmark
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 31 additions & 15 deletions .github/workflows/benchmark.yml
Expand Up @@ -11,15 +11,15 @@ jobs:
permissions:
contents: read
outputs:
PR-BENCH-14: ${{ steps.benchmark-pr.outputs.BENCH_RESULT14 }}
PR-BENCH-16: ${{ steps.benchmark-pr.outputs.BENCH_RESULT16 }}
PR-BENCH-18: ${{ steps.benchmark-pr.outputs.BENCH_RESULT18 }}
MAIN-BENCH-14: ${{ steps.benchmark-main.outputs.BENCH_RESULT14 }}
PR-BENCH-20: ${{ steps.benchmark-pr.outputs.BENCH_RESULT20 }}
MAIN-BENCH-16: ${{ steps.benchmark-main.outputs.BENCH_RESULT16 }}
MAIN-BENCH-18: ${{ steps.benchmark-main.outputs.BENCH_RESULT18 }}
MAIN-BENCH-20: ${{ steps.benchmark-main.outputs.BENCH_RESULT20 }}
strategy:
matrix:
node-version: [14, 16, 18]
node-version: [16, 18, 20]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -40,7 +40,9 @@ jobs:
run: |
npm run --silent benchmark > ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
echo 'BENCH_RESULT${{matrix.node-version}}<<EOF' >> $GITHUB_OUTPUT
echo "$result" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
# main benchmark
- uses: actions/checkout@v3
Expand All @@ -57,7 +59,9 @@ jobs:
run: |
npm run --silent benchmark > ./bench-result.md
result=$(awk '/requests in/' ./bench-result.md)
echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result"
echo 'BENCH_RESULT${{matrix.node-version}}<<EOF' >> $GITHUB_OUTPUT
echo "$result" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
output-benchmark:
needs: [benchmark]
Expand All @@ -70,12 +74,6 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
**Node**: 14
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-14 }}
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-14 }}
---
**Node**: 16
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-16 }}
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-16 }}
Expand All @@ -86,8 +84,26 @@ jobs:
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-18 }}
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-18 }}
- uses: actions-ecosystem/action-remove-labels@v1
---
**Node**: 20
**PR**: ${{ needs.benchmark.outputs.PR-BENCH-20 }}
**MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-20 }}
remove-label:
if: "always()"
needs:
- benchmark
- output-benchmark
runs-on: ubuntu-latest
steps:
- name: Remove benchmark label
uses: octokit/request-action@v2.x
id: remove-label
with:
labels: |
benchmark
github_token: ${{ secrets.GITHUB_TOKEN }}
route: DELETE /repos/{repo}/issues/{issue_number}/labels/{name}
repo: ${{ github.event.pull_request.head.repo.full_name }}
issue_number: ${{ github.event.pull_request.number }}
name: benchmark
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132 changes: 94 additions & 38 deletions .github/workflows/ci.yml
Expand Up @@ -36,7 +36,8 @@ jobs:
- name: Dependency review
uses: actions/dependency-review-action@v3

linter:
check-licenses:
name: Check licenses
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -49,6 +50,33 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
npm install --ignore-scripts
- name: Check licenses
run: |
npx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT;"
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
Expand All @@ -59,26 +87,34 @@ jobs:
npm run lint
coverage-nix:
needs: linter
needs: lint
permissions:
contents: read
uses: ./.github/workflows/coverage-nix.yml

coverage-win:
needs: linter
needs: lint
permissions:
contents: read
uses: ./.github/workflows/coverage-win.yml

test:
needs: [linter, coverage-nix, coverage-win]
test-unit:
needs:
- lint
- coverage-nix
- coverage-win
runs-on: ${{ matrix.os }}
permissions:
contents: read

strategy:
matrix:
node-version: [14, 16, 18, 19]
node-version: [14, 16, 18, 20]
os: [macos-latest, ubuntu-latest, windows-latest]
exclude:
# excludes node 14 on Windows
- os: windows-latest
node-version: 14

steps:
- uses: actions/checkout@v3
Expand All @@ -89,43 +125,51 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- uses: actions/cache@v3
id: check-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
npm install --ignore-scripts
- name: Check licenses
run: |
npm run license-checker
- name: Run tests
run: |
npm run test:ci
automerge:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs: test
runs-on: ubuntu-latest
npm run unit
test-typescript:
needs:
- lint
- coverage-nix
- coverage-win
runs-on: 'ubuntu-latest'
permissions:
pull-requests: write
contents: write
contents: read

steps:
- uses: fastify/github-action-merge-dependabot@v3
- uses: actions/checkout@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false

- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
npm install --ignore-scripts
- name: Run typescript tests
run: |
npm run test:typescript
env:
NODE_OPTIONS: no-network-family-autoselection

package:
needs: test
needs:
- test-typescript
- test-unit
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -137,13 +181,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- uses: actions/cache@v3
id: check-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'
cache-dependency-path: package.json
- name: install fastify
run: |
npm install --ignore-scripts
Expand All @@ -159,3 +198,20 @@ jobs:
- name: Test esbuild bundle
run: |
cd test/bundler/esbuild && npm run test
automerge:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs:
- test-typescript
- test-unit
- package
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 2 additions & 8 deletions .github/workflows/coverage-nix.yml
Expand Up @@ -16,14 +16,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- uses: actions/cache@v3
id: check-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/coverage-win.yml
Expand Up @@ -16,14 +16,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- uses: actions/cache@v3
id: check-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
Expand Down

0 comments on commit 5eb061b

Please sign in to comment.