name: CI

on:
  push:
    branches:
      - '**'
      - '!main'

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Setup Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          registry-url: https://registry.npmjs.org

      - name: Install dependencies
        run: npm install --frozen-lockfile

      - name: Run tests
        run: npm run test

      - name: Check code formatting
        run: npm run prettier

      - name: Lint code
        run: npm run lint
