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:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
name: Gradle Wrapper
# Run verifyPlugin and test Gradle tasks
# Build plugin and provide the artifact for the next workflow jobs
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
steps:
# Check out current repository
@ -36,17 +41,6 @@ jobs:
- name: Gradle Wrapper Validation
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
- name: Setup Java
uses: actions/setup-java@v2
@ -61,27 +55,19 @@ jobs:
shell: bash
run: |
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"
# Cache Plugin Verifier IDEs
- 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
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
# Run tests
- name: Run Tests
@ -95,12 +81,15 @@ jobs:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests
# Run verifyPlugin Gradle task
- name: Verify Plugin
run: ./gradlew verifyPlugin
# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
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
- name: Run Plugin Verifier
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
# Collect Plugin Verifier Result
@ -111,55 +100,20 @@ jobs:
name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier
# Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs
# Requires test job to be passed
build:
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
# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2.1-eap
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
# Collect Qodana Result
- uses: actions/upload-artifact@v2
with:
distribution: zulu
java-version: 11
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
name: qodana-result
path: ${{ github.workspace }}/qodana
# Store built plugin as an artifact for downloading
# Store already-built plugin as an artifact for downloading
- name: Upload artifacts
uses: actions/upload-artifact@v2.2.4
with:
name: "${{ steps.properties.outputs.name }} - ${{ steps.properties.outputs.version }}"
path: ./build/distributions/*
# Prepare a draft release for GitHub Releases page for the manual verification
@ -171,10 +125,6 @@ jobs:
runs-on: ubuntu-latest
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
- name: Remove Old Release Drafts
env:

@ -9,7 +9,10 @@
### Changed
- 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]
### Added

Loading…
Cancel
Save