name: Run tests

# Install dependencies and run tests
on:
  pull_request:
    branches: [ main ]

  workflow_dispatch:
    inputs:
      desc:
        description: 'Message'
        required: true
        default: 'Manual build'

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      GH_PAT: ${{ secrets.GH_PAT }}
    steps:
      - uses: actions/checkout@v2.4.0
      - name: Set Environment Variables
        uses: ./.github/actions/setvars
        with:
          varFilePath: ./.github/variables/node.env
      - name: Use Node.js
        uses: actions/setup-node@v3.1.0
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'yarn'
      - name: Install dependencies
        run: yarn install
#        uncomment this when the first test pops up
#      - name: Run tests
#        run: yarn test
      - name: Run linters
        run: yarn lint
      - name: Log
        run: yarn log
      - name: Run tsc
        run: yarn tsconfig
