AshLePoney/node-assert-enhanced

View on GitHub
.github/workflows/build.yml

Summary

Maintainability
Test Coverage
name: Build

on:
  push:
    branches:
      - '**'
    tags-ignore:
      - '**'

jobs:
  tests:
    name: Tests
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [12.x, 14.x, 16.x]
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v1
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: Install NPM dependencies
        run: npm install
      - name: Run test converage
        run: npm run coverage

  coverage:
    if: contains(github.ref, 'master')
    needs: [tests]
    name: CodeClimate Coverage
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v1
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: Run npm ci
        run: npm install
      - name: Runt test coverage
        run: npm run coverage
      - name: Report coverage to CodeClimate
        uses: paambaati/codeclimate-action@v2.7.5
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
        with:
          debug: true
          coverageCommand: npm run coverage