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

name: Validation

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v2
    
    - name: Validation
      uses: actions/setup-node@v2
      with:
        node-version: 16.x
    - run: npm ci
    - run: npm run lint
    - run: npm run test:coverage
    - run: npm run build && npm run clean

    - name: Coveralls report
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.github_token }}