nanoexpress/nanoexpress

View on GitHub
.github/workflows/pull_request.yml

Summary

Maintainability
Test Coverage
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Linting, Testing and Auto-merge

on: pull_request_target

env:
  CI: true

jobs:
  lint_test_build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        node-version: [20]
        os: [ubuntu-22.04]

    steps:
      - uses: actions/checkout@v4

      - name: Use Node.js
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'

      - name: Install
        run: npm ci

      - name: Lint code
        run: npm run lint

      - name: Test code
        run: npm run test

      - name: Build
        run: npm run build
  auto-merge:
    needs: lint_test_build
    timeout-minutes: 5

    runs-on: ubuntu-22.04
    if: github.actor == 'dependabot[bot]'

    steps:
      - uses: actions/checkout@v4
      - uses: ahmadnassri/action-dependabot-auto-merge@v2
        with:
          target: minor
          approve: true
          github-token: ${{ secrets.GH_TOKEN }}