Skip to content

Commit

Permalink
Merge pull request #4 from Konafets/feature/improve_github_workflow
Browse files Browse the repository at this point in the history
Feature/improve GitHub workflow
  • Loading branch information
Konafets authored Jun 12, 2022
2 parents 1712ed7 + dff2bd3 commit 3add979
Showing 1 changed file with 42 additions and 17 deletions.
59 changes: 42 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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') }}
Expand All @@ -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
Expand All @@ -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/*/*
Expand All @@ -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
Expand Down

0 comments on commit 3add979

Please sign in to comment.