diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fe30e00..9be205f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,10 +6,12 @@ updates: # Maintain dependencies for Gradle dependencies - package-ecosystem: "gradle" directory: "/" + target-branch: "next" schedule: interval: "daily" # Maintain dependencies for GitHub Actions - package-ecosystem: "github-actions" directory: "/" + target-branch: "next" schedule: interval: "daily" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b73a39..5cf636a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,12 @@ # GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps: -# - validate Gradle Wrapper, -# - run 'test' and 'verifyPlugin' tasks, -# - run Qodana inspections, -# - run 'buildPlugin' task and prepare artifact for the further tests, -# - run 'runPluginVerifier' task, -# - create a draft release. +# - Validate Gradle Wrapper. +# - Run 'test' and 'verifyPlugin' tasks. +# - Run Qodana inspections. +# - Run the 'buildPlugin' task and prepare artifact for further tests. +# - Run the 'runPluginVerifier' task. +# - Create a draft release. # -# Workflow is triggered on push and pull_request events. +# The workflow is triggered on push and pull_request events. # # GitHub Actions reference: https://help.github.com/en/actions # @@ -14,49 +14,39 @@ name: Build on: - # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) + # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests) push: branches: [ main ] # Trigger the workflow on any pull request pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: # Prepare environment and build the plugin build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: version: ${{ steps.properties.outputs.version }} changelog: ${{ steps.properties.outputs.changelog }} pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} steps: - # Free GitHub Actions Environment Disk Space - - name: Maximize Build Space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /usr/local/lib/android - sudo rm -rf /opt/ghc - - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 # Validate wrapper - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v3.3.2 - - # Setup Java environment for the next steps - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 17 + uses: gradle/actions/wrapper-validation@v3 # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 + uses: gradle/actions/setup-gradle@v4 # Set environment variables - name: Export Properties @@ -74,7 +64,7 @@ jobs: echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier + ./gradlew printProductsReleases # prepare list of IDEs for Plugin Verifier # Build plugin - name: Build plugin @@ -102,23 +92,16 @@ jobs: test: name: Test needs: [ build ] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - # Setup Java environment for the next steps - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 17 - # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 + uses: gradle/actions/setup-gradle@v4 # Run tests - name: Run Tests @@ -132,61 +115,68 @@ jobs: name: tests-result path: ${{ github.workspace }}/build/reports/tests - # Upload Kover report to CodeCov + # Upload the Kover report to CodeCov - name: Upload Code Coverage Report uses: codecov/codecov-action@v4 with: - files: ${{ github.workspace }}/build/reports/kover/xml/report.xml + files: ${{ github.workspace }}/build/reports/kover/report.xml # Run Qodana inspections and provide report inspectCode: name: Inspect code needs: [ build ] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: contents: write checks: write pull-requests: write steps: - # Check out current repository + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + large-packages: false + + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - - # Setup Java environment for the next steps - - name: Setup Java - uses: actions/setup-java@v4 with: - distribution: zulu - java-version: 17 + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis # Run Qodana inspections - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2024.1.4 + uses: JetBrains/qodana-action@v2024.3 with: cache-default-branch-only: true + pr-mode: false + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + QODANA_ENDPOINT: 'https://qodana.cloud' # Run plugin structure verification along with IntelliJ Plugin Verifier verify: name: Verify plugin - needs: [ build, test, inspectCode ] - runs-on: ubuntu-latest + needs: [ build ] + runs-on: ubuntu-24.04 steps: - # Check out current repository + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + large-packages: false + + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - # Setup Java environment for the next steps - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 17 - # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 + uses: gradle/actions/setup-gradle@v4 # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache @@ -197,7 +187,7 @@ jobs: # Run Verify Plugin task and IntelliJ Plugin Verifier tool - name: Run Plugin Verification tasks - run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} + run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} # Collect Plugin Verifier Result - name: Collect Plugin Verifier Result @@ -212,23 +202,16 @@ jobs: releaseDraft: name: Release draft if: github.event_name != 'pull_request' - needs: [ build, verify ] - runs-on: ubuntu-latest + needs: [ build, test, inspectCode, verify ] + runs-on: ubuntu-24.04 permissions: contents: write steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - # Setup Java environment for the next steps - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 17 - # Remove old release drafts by using the curl request for the available releases with a draft flag - name: Remove Old Release Drafts env: @@ -243,7 +226,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create v${{ needs.build.outputs.version }} \ + gh release create "v${{ needs.build.outputs.version }}" \ --draft \ --title "v${{ needs.build.outputs.version }}" \ --notes "$(cat << 'EOM' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ec4a72..ec2c546 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,31 +9,24 @@ on: jobs: - # Prepare and publish the plugin to the Marketplace repository + # Prepare and publish the plugin to JetBrains Marketplace repository release: name: Publish Plugin - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: contents: write pull-requests: write steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 with: ref: ${{ github.event.release.tag_name }} - # Setup Java environment for the next steps - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 17 - # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 + uses: gradle/actions/setup-gradle@v4 # Set environment variables - name: Export Properties @@ -49,7 +42,7 @@ jobs: echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - # Update Unreleased section with the current release note + # Update the Unreleased section with the current release note - name: Patch Changelog if: ${{ steps.properties.outputs.changelog != '' }} env: @@ -57,7 +50,7 @@ jobs: run: | ./gradlew patchChangelog --release-note="$CHANGELOG" - # Publish the plugin to the Marketplace + # Publish the plugin to JetBrains Marketplace - name: Publish Plugin env: PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} @@ -72,7 +65,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* - # Create pull request + # Create a pull request - name: Create Pull Request if: ${{ steps.properties.outputs.changelog != '' }} env: @@ -91,6 +84,7 @@ jobs: gh label create "$LABEL" \ --description "Pull requests with release changelog update" \ + --force \ || true gh pr create \ diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index c5fa155..c901413 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -1,9 +1,9 @@ # GitHub Actions Workflow for launching UI tests on Linux, Windows, and Mac in the following steps: -# - prepare and launch IDE with your plugin and robot-server plugin, which is needed to interact with UI -# - wait for IDE to start -# - run UI tests with separate Gradle task +# - Prepare and launch IDE with your plugin and robot-server plugin, which is needed to interact with the UI. +# - Wait for IDE to start. +# - Run UI tests with a separate Gradle task. # -# Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Platform +# Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Platform. # # Workflow is triggered manually. @@ -31,11 +31,11 @@ jobs: steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - # Setup Java environment for the next steps + # Set up Java environment for the next steps - name: Setup Java uses: actions/setup-java@v4 with: @@ -44,7 +44,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 + uses: gradle/actions/setup-gradle@v4 # Run IDEA prepared for UI testing - name: Run IDE diff --git a/.gitignore b/.gitignore index 20a7152..d1ed76b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .gradle .idea +.intellijPlatform .qodana build jflex-1.9.1.jar diff --git a/.idea/gradle.xml b/.idea/gradle.xml index ce1c62c..6b72a1e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,11 +5,13 @@ diff --git a/.run/Run Qodana.run.xml b/.run/Run Qodana.run.xml index c92f33c..6b31b81 100644 --- a/.run/Run Qodana.run.xml +++ b/.run/Run Qodana.run.xml @@ -1,11 +1,6 @@ -