# This workflow will do a clean install of node dependencies and run tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI

on:
  push:
    branches: ['*']
  pull_request:
    branches: [main]

jobs:
  lint:
    name: Static code analysis
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Install dependencies
        run: yarn --immutable
        env:
          HUSKY: 0

      - name: Run tests
        run: yarn lint

  unit:
    name: Unit tests
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Install dependencies
        run: yarn --immutable
        env:
          HUSKY: 0

      - name: Run tests
        run: yarn jest

# This workflow will do a clean install of node dependencies and run tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI

on:
  push:
    branches: ['*']
  pull_request:
    branches: [main]

jobs:
  lint:
    name: Static code analysis
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Cache .yarn/cache
        uses: actions/cache@v3
        env:
          cache-name: yarn-cache
        with:
          path: .yarn/cache
          key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-${{ env.cache-name }}

      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Install dependencies
        run: yarn --immutable
        env:
          HUSKY: 0

      - name: Run tests
        run: yarn lint

  unit:
    name: Unit tests
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Cache .yarn/cache
        uses: actions/cache@v3
        env:
          cache-name: yarn-cache
        with:
          path: .yarn/cache
          key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-${{ env.cache-name }}

      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Install dependencies
        run: yarn --immutable
        env:
          HUSKY: 0

      - name: Run tests
        run: yarn jest

Implement caching Yarn cache in GitHub Actions
Implement caching Yarn cache in GitHub Actions
