name: frontend

on:
  workflow_dispatch:
  pull_request:
    paths:
      - 'frontend/**'
  push:
    branches:
      - 'master'

jobs:
  build:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v4

      - name: Setup yarn
        uses: actions/setup-node@v4
        with:
          node-version: '18'
          cache: 'yarn'
          cache-dependency-path: frontend/yarn.lock

      - name: Install npm modules
        run: yarn
        working-directory: frontend

      - name: Run prettier, lint, jest checks
        run: yarn test
        working-directory: frontend
