From aecf1036f82d4836a2f1da7df0fe034f8b92d8e3 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Tue, 18 Apr 2023 09:34:42 +0100 Subject: [PATCH] ci: update workflow --- .github/workflows/ci.yml | 90 ++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7abaf82..3bdf89b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,35 +1,79 @@ -name: CI +name: ci on: - pull_request: push: + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.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@v3 + with: + persist-credentials: false + + - name: Dependency review + uses: actions/dependency-review-action@v3 + test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - node-version: [14, 16, 18, 19] - os: [macos-latest, ubuntu-latest, windows-latest] + name: Test + runs-on: ${{ matrix.os }} + permissions: + contents: read + strategy: + matrix: + node-version: [14, 16, 18, 19] + os: [macos-latest, ubuntu-latest, windows-latest] + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + persist-credentials: false - steps: - - uses: actions/checkout@v3 + - name: Setup Node ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm i --ignore-scripts - - name: Install - run: | - npm install + - name: Install peerdeps + run: npm i fastify @sinclair/typebox - - name: Install PeerDeps - run: npm i fastify @sinclair/typebox + - name: Lint code + run: npm run lint - - name: Run lint - run: npm run lint + - name: Run tests + run: npm test - - name: Run tests - run: | - npm run test + automerge: + name: Automatically merge Dependabot pull requests + if: > + github.event_name == 'pull_request' && + github.event.pull_request.user.login == 'dependabot[bot]' + needs: test + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - uses: fastify/github-action-merge-dependabot@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }}