name: CI

on:
  push:
    branches:
      - main
      - master
  pull_request: {}

concurrency:
  group: ci-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

jobs:
  lint:
    name: "Lint"
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
      - name: Install Node
        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
        with:
          node-version: 12.x
          cache: yarn
      - name: Install Dependencies
        run: yarn install --frozen-lockfile
      - name: Lint
        run: yarn lint

  test:
    name: "Test"
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
      - name: Install Node
        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
        with:
          node-version: 12.x
          cache: yarn
      - name: Install Dependencies
        run: yarn install --frozen-lockfile
      - name: Run Tests
        run: yarn test
