From e86af05d3e1782b8e1e1051f0738ccb20f332dcc Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Wed, 13 Nov 2024 18:34:27 +0100 Subject: [PATCH] chore: update workflows (#143) --- .github/workflows/build.yml | 44 ++++++++++++------------------ .github/workflows/release.yml | 8 ++---- .github/workflows/run-ui-tests.yml | 6 ++-- 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46b9176..3f7f649 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,10 @@ on: # 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 @@ -32,13 +36,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@v3.3.2 + uses: gradle/actions/wrapper-validation@v3 # Set up Java environment for the next steps - name: Setup Java @@ -49,9 +53,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-home-cache-cleanup: true + uses: gradle/actions/setup-gradle@v4 # Set environment variables - name: Export Properties @@ -69,8 +71,6 @@ jobs: echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier - # Build plugin - name: Build plugin run: ./gradlew buildPlugin @@ -100,7 +100,7 @@ jobs: runs-on: ubuntu-latest steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 @@ -113,9 +113,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-home-cache-cleanup: true + uses: gradle/actions/setup-gradle@v4 # Run tests - name: Run Tests @@ -153,9 +151,12 @@ jobs: tool-cache: false large-packages: false - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 + with: + 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 # Set up Java environment for the next steps - name: Setup Java @@ -185,7 +186,7 @@ jobs: tool-cache: false large-packages: false - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 @@ -198,9 +199,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-home-cache-cleanup: true + uses: gradle/actions/setup-gradle@v4 # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache @@ -211,7 +210,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 @@ -232,17 +231,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 +249,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 ef10f57..5174ab9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: pull-requests: write steps: - # Check out current repository + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 with: @@ -33,9 +33,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-home-cache-cleanup: true + uses: gradle/actions/setup-gradle@v4 # Set environment variables - name: Export Properties @@ -51,7 +49,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: diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index aedb91d..c901413 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/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,9 +44,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-home-cache-cleanup: true + uses: gradle/actions/setup-gradle@v4 # Run IDEA prepared for UI testing - name: Run IDE