name: Build, lint and run tests

on:
  push:
    branches:
    - main
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: Install
      run: |
        yarn policies set-version '^1.22.10'
    - run: yarn && yarn sanity