2024.3 Build Support. #261
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps: | |
# - validate Gradle Wrapper, | |
# - run test and verifyPlugin tasks, | |
# - run buildPlugin task and prepare artifact for the further tests, | |
# - run IntelliJ Plugin Verifier, | |
# - create a draft release. | |
# | |
# Workflow is triggered on push and pull_request events. | |
# | |
# Docs: | |
# - GitHub Actions: https://help.github.com/en/actions | |
# - IntelliJ Plugin Verifier GitHub Action: https://github.com/ChrisCarini/intellij-platform-plugin-verifier-action | |
# | |
name: Build | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum | |
gradleValidation: | |
name: Gradle Wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v2 | |
- name: Gradle Wrapper Validation | |
uses: gradle/[email protected] | |
# Run verifyPlugin and test Gradle tasks | |
test: | |
name: Test | |
needs: gradleValidation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Fetch Sources | |
uses: actions/checkout@v2 | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Run Linters and Test | |
run: ./gradlew check | |
- name: Verify Plugin | |
run: ./gradlew verifyPlugin | |
# 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: | |
name: ${{ steps.properties.outputs.name }} | |
version: ${{ steps.properties.outputs.version }} | |
artifact: ${{ steps.properties.outputs.artifact }} | |
steps: | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Fetch Sources | |
uses: actions/checkout@v2 | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Set environment variables | |
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 ' ')" | |
ARTIFACT="${NAME}-${VERSION}.zip" | |
echo "::set-output name=version::$VERSION" | |
echo "::set-output name=name::$NAME" | |
echo "::set-output name=artifact::$ARTIFACT" | |
- name: Build Plugin | |
run: ./gradlew buildPlugin | |
# Upload plugin artifact to make it available in the next jobs | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: plugin-artifact | |
path: ./build/distributions/${{ needs.build.outputs.artifact }} | |
# Verify built plugin using IntelliJ Plugin Verifier tool | |
# Requires build job to be passed | |
verify: | |
name: Verify | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Fetch Sources | |
uses: actions/checkout@v2 | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
# Set environment variables | |
- name: Export Properties | |
id: properties | |
shell: bash | |
run: | | |
PROPERTIES="$(./gradlew properties --console=plain -q)" | |
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)" | |
echo "::set-output name=ideVersions::$IDE_VERSIONS" | |
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" | |
# Cache Plugin Verifier IDEs | |
- name: Setup Plugin Verifier IDEs Cache | |
uses: actions/[email protected] | |
with: | |
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides | |
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }} | |
# Run IntelliJ Plugin Verifier action using GitHub Action | |
- name: Verify Plugin | |
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} |