name: Test
on:
  push:
    branches:
      - main
      - production
  pull_request:
    branches:

jobs:
  test:
    name: Run tests
    runs-on: ubuntu-latest

    steps:
      - name: Clone repository
        uses: actions/checkout@v3

      - name: Set up node
        uses: actions/setup-node@v3
        with:
          node-version: lts/*

      - name: Install dependencies
        run: npm install --legacy-peer-deps

      - name: Run tests
        run: npm run test
