name: Tests

on: push

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

      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: "16"
          cache: "yarn"

      - name: Install packages
        run: yarn install

      - name: Build
        run: yarn build

      - name: Lint
        run: yarn lint

      - name: Typecheck
        run: yarn typecheck

      - name: Clear Jest
        run: yarn jest --clearCache

      - name: Test
        run: yarn test --coverage

      # - name: Send Report
      #   uses: paambaati/codeclimate-action@v3.0.0
      #   env:
      #     CC_TEST_REPORTER_ID: 7d1e3713df373ab2c9efce24b85c16efa2bd953aae32bd9d278004784d71291e
      #   with:
      #     coverageLocations: ${{github.workspace}}/coverage/lcov.info:lcov
