diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8558398..0c7f754 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,75 @@ +on: + push: + branches: + - main + - next + - 'v*' + pull_request: + paths-ignore: + - LICENSE + - '*.md' + name: CI -on: [push, pull_request] jobs: - build: + lint: + permissions: + contents: read + name: Lint runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Install Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: v22.x + cache: 'npm' + cache-dependency-path: package.json + + - name: Install dependencies + run: npm install + - name: Check linting + run: npm run lint:ci + + tests: + permissions: + contents: read + name: Tests strategy: + fail-fast: false matrix: - node: [18.x, 20.x, 21.x] - name: Node ${{ matrix.node }} + os: [ubuntu-latest, macos-latest, windows-latest] + node-version: [20.x, 22.x, 24.x] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: package.json + + - name: Install Dependencies + run: npm install + + - name: Run Tests + run: npm run test:ci + + automerge: + if: > + github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' + needs: + - tests + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 + - name: Merge Dependabot PR + uses: fastify/github-action-merge-dependabot@e820d631adb1d8ab16c3b93e5afe713450884a4a # v3.11.1 with: - node-version: ${{ matrix.node }} - - run: npm install - - run: npm run test:ci + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index b5b7d32..5895224 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "release": "npx standard-version --no-verify" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "keywords": [ "fastify",