name: Test IntelliJ

on:
  pull_request:
    branches: [ main ]
    paths:
      - '.github/workflows/test-intellij.yml'
      - 'clients/intellij/**'

concurrency:
  group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} 
  
  # If this is enabled it will cancel current running and start latest
  cancel-in-progress: true

jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          lfs: true
      - name: Setup JDK
        uses: actions/setup-java@v3
        with:
          distribution: zulu
          java-version: 17
      - name: Test Build
        uses: gradle/gradle-build-action@v2.4.2
        with:
          arguments: buildPlugin
          build-root-directory: clients/intellij
