iamolegga/nestjs-roles

View on GitHub
.github/workflows/build-lint-test.yml

Summary

Maintainability
Test Coverage
name: build-lint-test

on:
  workflow_call:

jobs:
  build-lint-test:
    strategy:
      fail-fast: true
      matrix:
        nestjs-version:
          - "8"
          - "9"
          - "10"
        nodejs-version:
          - 16
          - 18
          - 20

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.nodejs-version }}
      - run: npm ci
      - run: |
          npm i @nestjs/core@${{ matrix.nestjs-version }} \
                @nestjs/common@${{ matrix.nestjs-version }} \
                @nestjs/platform-express@${{ matrix.nestjs-version }} \
                @nestjs/platform-fastify@${{ matrix.nestjs-version }} \
                @types/node@${{ matrix.nodejs-version }} \
                -D
      - run: npm run lint
      - uses: actions/cache@v3
        with:
          path: coverage
          key: ${{ github.sha }}-${{ matrix.nestjs-version }}-${{ matrix.nodejs-version }}
      - run: npm t
      - run: npm run build