name: 🚀CI🔥
on:
  push:
    branches:
      - "**" # all branches

  pull_request:
    branches:
      - main

jobs:
  test:
    name: 🚀🚀 Unit Tests
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: ./

    steps:
      - name: 🚀 Checkout Github Repository
        uses: actions/checkout@v4

      - name: 🚀 Setup Nodejs and NPM
        uses: actions/setup-node@v4
        with:
          node-version: 18

      - name: 🚀 Installing Packages using Yarn
        run: yarn install

      - name: 🚀 Running Tests
        run: yarn test

  linting:
    name: 🚀🚀 Code Linting
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: ./

    steps:
      - name: 🚀 Checkout Github Repository
        uses: actions/checkout@v4

      - name: 🚀 Setup Nodejs and NPM
        uses: actions/setup-node@v4
        with:
          node-version: 18
      - name: 🚀 Installing Packages using Yarn
        run: yarn install

      - name: 🚀 Linting and building
        run: yarn lint && npx standard -v
