From e7761a1e0708c68a278e168d995f94aa13606825 Mon Sep 17 00:00:00 2001 From: KotlinIsland Date: Sat, 10 Aug 2024 16:06:52 +1000 Subject: [PATCH] intellij: pull template --- .../{build.yml => intellij-build.yml} | 50 +++--- .../{release.yml => intellij-release.yml} | 62 +++---- ...ui-tests.yml => intellij-run-ui-tests.yml} | 6 +- .idea/vcs.xml | 5 + intellij/.gitignore | 1 + intellij/.run/Run IDE for UI Tests.run.xml | 25 --- intellij/.run/Run Qodana.run.xml | 30 ---- intellij/.run/Run Tests.run.xml | 1 + intellij/.run/Run Verifications.run.xml | 7 +- intellij/CHANGELOG.md | 9 +- intellij/build.gradle.kts | 160 +++++++++++------- intellij/gradle.properties | 6 +- intellij/gradle/libs.versions.toml | 12 +- 13 files changed, 187 insertions(+), 187 deletions(-) rename .github/workflows/{build.yml => intellij-build.yml} (87%) rename .github/workflows/{release.yml => intellij-release.yml} (65%) rename .github/workflows/{run-ui-tests.yml => intellij-run-ui-tests.yml} (92%) delete mode 100644 intellij/.run/Run IDE for UI Tests.run.xml delete mode 100644 intellij/.run/Run Qodana.run.xml diff --git a/.github/workflows/build.yml b/.github/workflows/intellij-build.yml similarity index 87% rename from .github/workflows/build.yml rename to .github/workflows/intellij-build.yml index a2de45f..309568b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/intellij-build.yml @@ -22,6 +22,10 @@ on: paths: - "intellij/**" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: # Prepare environment and build the plugin @@ -34,13 +38,13 @@ jobs: pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} steps: - # 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@v1.1.0 + uses: gradle/actions/wrapper-validation@v3 # Set up Java environment for the next steps - name: Setup Java @@ -51,7 +55,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true @@ -72,8 +76,6 @@ jobs: echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier - # Build plugin - name: Build plugin working-directory: ./intellij @@ -92,7 +94,7 @@ jobs: # Store already-built plugin as an artifact for downloading - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.artifact.outputs.filename }} path: ./intellij/build/distributions/content/*/* @@ -104,7 +106,7 @@ jobs: runs-on: ubuntu-latest steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 @@ -117,7 +119,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true @@ -129,14 +131,14 @@ jobs: # Collect Tests Result of failed tests - name: Collect Tests Result if: ${{ failure() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tests-result path: ${{ github.workspace }}/intellij/build/reports/tests # Upload the Kover report to CodeCov - name: Upload Code Coverage Report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ${{ github.workspace }}/intellij/build/reports/kover/report.xml @@ -158,7 +160,7 @@ jobs: tool-cache: false large-packages: false - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 @@ -169,6 +171,11 @@ jobs: distribution: zulu java-version: 17 + # Run Qodana inspections +# - name: Qodana - Code Inspection +# uses: JetBrains/qodana-action@v2024.1.5 +# with: +# cache-default-branch-only: true # Run plugin structure verification along with IntelliJ Plugin Verifier verify: @@ -184,7 +191,7 @@ jobs: tool-cache: false large-packages: false - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 @@ -197,13 +204,13 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides key: plugin-verifier-${{ hashFiles('intellij/build/listProductsReleases.txt') }} @@ -211,12 +218,12 @@ jobs: # Run Verify Plugin task and IntelliJ Plugin Verifier tool - name: Run Plugin Verification tasks working-directory: ./intellij - 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 if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pluginVerifier-result path: ${{ github.workspace }}/intellij/build/reports/pluginVerifier @@ -232,17 +239,10 @@ jobs: # contents: write # steps: # -# # Check out current repository +# # Check out the current repository # - name: Fetch Sources # uses: actions/checkout@v4 # -# # Set up 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: @@ -257,7 +257,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/intellij-release.yml similarity index 65% rename from .github/workflows/release.yml rename to .github/workflows/intellij-release.yml index 5bb0bdf..439204d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/intellij-release.yml @@ -19,7 +19,7 @@ jobs: pull-requests: write steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 with: @@ -34,7 +34,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true @@ -52,8 +52,9 @@ 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 + working-directory: ./intellij if: ${{ steps.properties.outputs.changelog != '' }} env: CHANGELOG: ${{ steps.properties.outputs.changelog }} @@ -62,6 +63,7 @@ jobs: # Publish the plugin to JetBrains Marketplace - name: Publish Plugin + working-directory: ./intellij env: PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} @@ -73,32 +75,32 @@ jobs: - name: Upload Release Asset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* + run: gh release upload ${{ github.event.release.tag_name }} ./intellij/build/distributions/* # Create a pull request - - name: Create Pull Request - if: ${{ steps.properties.outputs.changelog != '' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - VERSION="${{ github.event.release.tag_name }}" - BRANCH="changelog-update-$VERSION" - LABEL="release changelog" - - git config user.email "action@github.com" - git config user.name "GitHub Action" - - git checkout -b $BRANCH - git commit -am "Changelog update - $VERSION" - git push --set-upstream origin $BRANCH - - gh label create "$LABEL" \ - --description "Pull requests with release changelog update" \ - --force \ - || true - - gh pr create \ - --title "Changelog update - \`$VERSION\`" \ - --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ - --label "$LABEL" \ - --head $BRANCH +# - name: Create Pull Request +# if: ${{ steps.properties.outputs.changelog != '' }} +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: | +# VERSION="${{ github.event.release.tag_name }}" +# BRANCH="changelog-update-$VERSION" +# LABEL="release changelog" +# +# git config user.email "action@github.com" +# git config user.name "GitHub Action" +# +# git checkout -b $BRANCH +# git commit -am "Changelog update - $VERSION" +# git push --set-upstream origin $BRANCH +# +# gh label create "$LABEL" \ +# --description "Pull requests with release changelog update" \ +# --force \ +# || true +# +# gh pr create \ +# --title "Changelog update - \`$VERSION\`" \ +# --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ +# --label "$LABEL" \ +# --head $BRANCH diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/intellij-run-ui-tests.yml similarity index 92% rename from .github/workflows/run-ui-tests.yml rename to .github/workflows/intellij-run-ui-tests.yml index 05e483b..6b60acd 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/intellij-run-ui-tests.yml @@ -31,7 +31,7 @@ jobs: steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 @@ -44,7 +44,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true @@ -54,7 +54,7 @@ jobs: # Wait for IDEA to be started - name: Health Check - uses: jtalk/url-health-check-action@v3 + uses: jtalk/url-health-check-action@v4 with: url: http://127.0.0.1:8082 max-attempts: 15 diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1dd..8d3e42f 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,5 +1,10 @@ + + + diff --git a/intellij/.gitignore b/intellij/.gitignore index e2e5d94..ffabde6 100644 --- a/intellij/.gitignore +++ b/intellij/.gitignore @@ -1,4 +1,5 @@ .gradle .idea +.intellijPlatform .qodana build diff --git a/intellij/.run/Run IDE for UI Tests.run.xml b/intellij/.run/Run IDE for UI Tests.run.xml deleted file mode 100644 index ee99b7e..0000000 --- a/intellij/.run/Run IDE for UI Tests.run.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - true - true - false - false - - - \ No newline at end of file diff --git a/intellij/.run/Run Qodana.run.xml b/intellij/.run/Run Qodana.run.xml deleted file mode 100644 index c92f33c..0000000 --- a/intellij/.run/Run Qodana.run.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - true - true - false - false - - - \ No newline at end of file diff --git a/intellij/.run/Run Tests.run.xml b/intellij/.run/Run Tests.run.xml index 132d9ad..f281bdc 100644 --- a/intellij/.run/Run Tests.run.xml +++ b/intellij/.run/Run Tests.run.xml @@ -19,6 +19,7 @@ true true false + true diff --git a/intellij/.run/Run Verifications.run.xml b/intellij/.run/Run Verifications.run.xml index 3a8d688..32783f5 100644 --- a/intellij/.run/Run Verifications.run.xml +++ b/intellij/.run/Run Verifications.run.xml @@ -11,7 +11,7 @@