name: Build
run-name: Running Lint Check and Licence checker on Pull Request
on: [pull_request]

jobs:
  Build-and-ng-test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18

      - name: Write .npmrc file
        run: echo "$NPMRC" > client/.npmrc
        shell: bash
        env:
          NPMRC: ${{ secrets.NPMRC}}

      - name: Lint check
        run: npm run lint:check

      - name: Licence checker
        run: |
          cd client
          npm ci
          npm run license-checker