name: Unit Test

# Meant to be run only on pull request
on: [pull_request, push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1

      # Setting up nodejs
      - uses: actions/setup-node@v3

        # Setting up NodeJS version matching the version in Docker container
        with:
          node-version: 14

      # Installing dependencies and running tests
      - name: Install dependencies and run tests
        run: |
          yarn
          yarn test
