name: tests
on:
  push:
    branches:
      - main
  pull_request:

jobs:
  main:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: nrwl/nx-set-shas@v2
      - run: npm ci
      - run: npx nx workspace-lint
      # TODO: re-enable when it stops erroring constantly about package.json
      # - run: npx nx format:check
      - run: npx nx affected --target=lint
      - run: npx nx affected --target=test --ci --code-coverage
      - run: npx nx affected --target=build
