exoRift/cyclone-engine

View on GitHub
.github/workflows/quality_assurance.yml

Summary

Maintainability
Test Coverage
name: Quality Assurance

on: 
  push:
    branches:
      - master
      - dev
  pull_request:
    branches:
      - '*'
      - '!gh-pages'

jobs:
  test:
    name: Unit Testing (Ava)

    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [12.x]
        
    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Set up Node
        uses: actions/setup-node@v1.4.2
        with:
          node-version: ${{ matrix.node-version }}
      - name: Cache Dependencies
        id: dep-cache
        uses: actions/cache@v1.1.2
        env:
          cache-name: dep-cache
        with:
          path: |
            **/node_modules/
            ~/.npm/
          key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-build-${{ env.cache-name }}-
            ${{ runner.os }}-build-
            ${{ runner.os }}-
      - name: Install Dependencies
        run: npm ci
        if: steps.dep-cache.outputs.cache-hit != 'true'
      - name: Run Tests
        run: npm test
      - name: Upload Coverage
        if: success()
        uses: paambaati/codeclimate-action@v2.6.0
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
        with:
          coverageCommand: 'echo'
          coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov
  lint:
    name: Linting

    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [12.x]

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

    steps:
      - uses: actions/checkout@v2
      - name: Set up Node
        uses: actions/setup-node@v1.4.2
        with:
          node-version: ${{ matrix.node-version }}
      - name: Cache Dependencies
        id: dep-cache
        uses: actions/cache@v1.1.2
        env:
          cache-name: dep-cache
        with:
          path: |
            **/node_modules/
            ~/.npm/
          key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-build-${{ env.cache-name }}-
            ${{ runner.os }}-build-
            ${{ runner.os }}-
      - name: Install Dependencies
        run: npm ci
        if: steps.dep-cache.outputs.cache-hit != 'true'
      - name: Lint Code
        run: npm run lint