GitHub Actions general performance refactoring

pull/204/head
Jakub Chrzanowski 3 years ago committed by Jakub Chrzanowski
parent badb6ae1db
commit d8648e589d

@ -23,9 +23,14 @@ on:
jobs: jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum # Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation: # Run verifyPlugin and test Gradle tasks
name: Gradle Wrapper # Build plugin and provide the artifact for the next workflow jobs
build:
name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
steps: steps:
# Check out current repository # Check out current repository
@ -36,17 +41,6 @@ jobs:
- name: Gradle Wrapper Validation - name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.4 uses: gradle/wrapper-validation-action@v1.0.4
# Run verifyPlugin and test Gradle tasks
test:
name: Test
needs: gradleValidation
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.3.4
# Setup Java 11 environment for the next steps # Setup Java 11 environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v2 uses: actions/setup-java@v2
@ -61,27 +55,19 @@ jobs:
shell: bash shell: bash
run: | run: |
PROPERTIES="$(./gradlew properties --console=plain -q)" PROPERTIES="$(./gradlew properties --console=plain -q)"
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)" VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=ideVersions::$IDE_VERSIONS" echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=changelog::$CHANGELOG"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
# Cache Plugin Verifier IDEs ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v2.1.6
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ steps.properties.outputs.ideVersions }}
# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2.1-eap
# Collect Qodana Result
- uses: actions/upload-artifact@v2
with:
name: qodana-result
path: ${{ github.workspace }}/qodana
# Run tests # Run tests
- name: Run Tests - name: Run Tests
@ -95,12 +81,15 @@ jobs:
name: tests-result name: tests-result
path: ${{ github.workspace }}/build/reports/tests path: ${{ github.workspace }}/build/reports/tests
# Run verifyPlugin Gradle task # Cache Plugin Verifier IDEs
- name: Verify Plugin - name: Setup Plugin Verifier IDEs Cache
run: ./gradlew verifyPlugin uses: actions/cache@v2.1.6
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles("build/listProductsReleases.txt") }}
# Run IntelliJ Plugin Verifier action using GitHub Action # Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verifier - name: Run Plugin Verification tasks
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
# Collect Plugin Verifier Result # Collect Plugin Verifier Result
@ -111,55 +100,20 @@ jobs:
name: pluginVerifier-result name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier path: ${{ github.workspace }}/build/reports/pluginVerifier
# Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs # Run Qodana inspections
# Requires test job to be passed - name: Qodana - Code Inspection
build: uses: JetBrains/qodana-action@v2.1-eap
name: Build
needs: test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.3.4
# Setup Java 11 environment for the next steps # Collect Qodana Result
- name: Setup Java - uses: actions/upload-artifact@v2
uses: actions/setup-java@v2
with: with:
distribution: zulu name: qodana-result
java-version: 11 path: ${{ github.workspace }}/qodana
cache: gradle
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=changelog::$CHANGELOG"
# Build artifact using buildPlugin Gradle task
- name: Build Plugin
run: ./gradlew buildPlugin
# Store built plugin as an artifact for downloading # Store already-built plugin as an artifact for downloading
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v2.2.4
with: with:
name: "${{ steps.properties.outputs.name }} - ${{ steps.properties.outputs.version }}"
path: ./build/distributions/* path: ./build/distributions/*
# Prepare a draft release for GitHub Releases page for the manual verification # Prepare a draft release for GitHub Releases page for the manual verification
@ -171,10 +125,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.3.4
# Remove old release drafts by using the curl request for the available releases with draft flag # Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts - name: Remove Old Release Drafts
env: env:

@ -9,7 +9,10 @@
### Changed ### Changed
- Dependencies - upgrade `org.jetbrains.intellij` to `1.2.0` - Dependencies - upgrade `org.jetbrains.intellij` to `1.2.0`
- Update `pluginVerifierIdeVersions` to `2021.2.2` - GitHub Actions general performance refactoring
### Removed
- Removed the `pluginVerifierIdeVersions` configuration to use default IDEs list provided by the `listProductsReleases` task for `runPluginVerifier`
## [1.0.0] ## [1.0.0]
### Added ### Added

Loading…
Cancel
Save