diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c43438c3..c565a912 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,33 +21,58 @@ on: pull_request: jobs: - # Run Gradle Wrapper Validation Action to verify the wrapper's checksum + gradleValidation: + name: Gradle Wrapper + runs-on: ubuntu-latest + steps: + # Checkout the current repository + - name: Fetch Sources + uses: actions/checkout@v3 + + # Validate wrapper + - name: Gradle Wrapper Validation + uses: gradle/wrapper-validation-action@v1.0.4 + # Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks # Build plugin and provide the artifact for the next workflow jobs build: name: Build + needs: gradleValidation runs-on: ubuntu-latest outputs: + name: ${{ steps.properties.outputs.name }} version: ${{ steps.properties.outputs.version }} changelog: ${{ steps.properties.outputs.changelog }} - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.4.0 - - # Validate wrapper - - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.0.4 + steps: # Setup Java 11 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v3.3.0 with: distribution: zulu java-version: 11 - cache: gradle + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v3 + + # Cache Gradle Dependencies + - name: Setup Gradle Dependencies Cache + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} + ${{ runner.os }}-gradle-caches + + # Cache Gradle Wrapper + - name: Setup Gradle Wrapper Cache + uses: actions/cache@v3 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} # Set environment variables - name: Export Properties @@ -83,7 +108,7 @@ jobs: # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3 with: path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} @@ -95,14 +120,14 @@ jobs: # Collect Plugin Verifier Result - name: Collect Plugin Verifier Result if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pluginVerifier-result path: ${{ github.workspace }}/build/reports/pluginVerifier # Run Qodana inspections - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v4.2.5 + uses: JetBrains/qodana-action@v5.1.0 # Prepare plugin archive content for creating artifact - name: Prepare Plugin Artifact @@ -117,7 +142,7 @@ jobs: # Store already-built plugin as an artifact for downloading - name: Upload artifact - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v3 with: name: ${{ steps.artifact.outputs.filename }} path: ./build/distributions/content/*/* @@ -133,7 +158,7 @@ jobs: # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 # Remove old release drafts by using the curl request for the available releases with draft flag - name: Remove Old Release Drafts