name: Test IntelliJ Plugin

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

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - 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
