name: Test

# Controls when the workflow will run
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # build the npm project. Generates js files by compiling ts files
  test:
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v3
      # sets up node environment
      - uses: actions/setup-node@v3
        with:
          node-version: '14.6.0'
      - run: npm install
      - run: npm run build
      - run: npm test