name: Qodana Scan

on:
  push:
    branches:
      - master

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
  cancel-in-progress: true

jobs:
  qodana-scan:
    if: false

    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest]
        node: [18]

    steps:
      - name: Checkout 🛎
        uses: actions/checkout@master
        with:
          fetch-depth: 0

      - name: Setup node env 🏗
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node }}
          check-latest: true

      - name: Install Dependencies 👨🏻‍💻
        uses: ./.github/actions/install-dependencies

      - name: Setup Turbo cache 🏎️
        id: turbo-cache
        uses: actions/cache@v2
        with:
          path: .turbo
          key: turbo-${{ runner.os }}-${{ github.sha }}
          restore-keys: |
            turbo-${{ runner.os }}-

      - name: Build Library 👷
        run: pnpm run build --cache-dir=.turbo

      - name: Qodana Scan 🔍
        uses: JetBrains/qodana-action@main
        env:
          QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
