Update #15
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
name: CI | |
on: | |
push: | |
# branches: | |
# - main | |
# - master | |
# - next | |
# - "v*" | |
paths-ignore: | |
- "docs/**" | |
- "*.md" | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "*.md" | |
# Jobs got from https://github.com/fastify/workflows/blob/main/.github/workflows/plugins-ci.yml | |
# and changed to use pnpm first | |
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@v4 | |
license-check: | |
if: > | |
!failure() && | |
!cancelled() | |
name: Check Licenses | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: pnpm i --ignore-scripts | |
- name: Check Licenses | |
run: ${{ format('pnpm dlx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;BlueOak-1.0.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT;{0}"', inputs.license-check-allowed-additional) }} | |
linter: | |
name: Lint Code | |
if: > | |
!failure() && | |
!cancelled() | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: pnpm i --ignore-scripts | |
- name: Lint code | |
run: pnpm lint | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
node-version: ${{ fromJson('["20", "22"]') }} | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
exclude: | |
- os: macos-latest | |
node-version: 14 | |
- os: macos-latest | |
node-version: 16 | |
steps: | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- 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: pnpm i --ignore-scripts | |
- name: Run tests | |
run: pnpm test | |
fastify-dependency-integration: | |
name: Test Fastify Integration | |
runs-on: ubuntu-latest | |
if: > | |
!failure() && | |
!cancelled() | |
permissions: | |
contents: read | |
steps: | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: pnpm i --ignore-scripts | |
- name: Test Fastify Integration | |
run: | | |
npm link && | |
PACKAGE_NAME=$(node -p "require('./package.json').name") | |
git clone https://github.com/fastify/fastify.git --depth 1 && | |
cd fastify && | |
npm i --ignore-scripts && | |
npm link $PACKAGE_NAME && | |
npm run unit |