#74: Upgrading plugin to support IJ 2024 #389
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
name: Build Plugin | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum | |
gradleValidation: | |
name: Gradle Wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Validate wrapper | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1 | |
# Run verifyPlugin and test Gradle tasks | |
test: | |
name: Test | |
needs: gradleValidation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Verify no java files committed. Note this is run before any gen/* files are created | |
- name: Verify Kotlin Source Files Only | |
run: | | |
javafiles=(`find src -iname *.java`) | |
if [ ${#javafiles[@]} -gt 0 ] | |
then | |
echo "ERROR: Detected a java file in the committed source code! Only kotlin files are allowed." >&2 | |
printf '%s\n' "${javafiles[@]}" 1>&2 | |
exit 1 | |
fi | |
echo "SUCCESS: No java files detected in the committed source code" | |
# Setup Java 17 environment for the next steps | |
- name: Setup Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: gradle | |
# Cache Gradle dependencies | |
- name: Setup Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} | |
# Cache Gradle Wrapper | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
# Run EditorConfig Linter | |
- name: Run EditorConfig Linter | |
uses: editorconfig-checker/action-editorconfig-checker@main | |
# Run ktlint | |
- name: Run KtLinter | |
run: ./gradlew ktlintCheck | |
# Run test Gradle task | |
- name: Run Tests | |
run: ./gradlew test | |
# Verify code coverage | |
- name: Check Code Coverage | |
run: ./gradlew jacocoTestCoverageVerification | |
# Run verifyPlugin Gradle task | |
- 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 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: gradle | |
# Cache Gradle Dependencies | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} | |
# Cache Gradle Wrapper | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
# Build artifact using buildPlugin Gradle task | |
- name: Build Plugin | |
run: ./gradlew buildPlugin | |
# Upload plugin artifact to make it available in the next jobs | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: plugin-artifact | |
path: ./build/distributions | |
# 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: Checkout "ide-versions" File for the Verifier Action to Use | |
uses: actions/checkout@v2 | |
# Download plugin artifact provided by the previous job. | |
# This will auto-extract zip contents into the current directory | |
- name: Download Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: plugin-artifact | |
# Run IntelliJ Plugin Verifier action using GitHub Action | |
- name: Verify Plugin Compatibility | |
id: verify | |
uses: ChrisCarini/intellij-platform-plugin-verifier-action@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
plugin-location: '*.zip' | |
# NOTE: For ide-versions, we just need to verify IJ community & one non-IJ IDE. | |
ide-versions: .github/workflows/ide_versions_to_verify.txt | |
failure-levels: | | |
COMPATIBILITY_WARNINGS | |
COMPATIBILITY_PROBLEMS | |
DEPRECATED_API_USAGES | |
INTERNAL_API_USAGES | |
OVERRIDE_ONLY_API_USAGES | |
NON_EXTENDABLE_API_USAGES | |
PLUGIN_STRUCTURE_WARNINGS | |
MISSING_DEPENDENCIES | |
INVALID_PLUGIN | |
NOT_DYNAMIC |