Add new plugin icon (#21) #112
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: Project CI | |
on: | |
pull_request: # all PRs | |
push: | |
branches: | |
- master | |
env: | |
JAVA_DISTRIBUTION: "temurin" | |
JAVA_VERSION: "17" | |
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true | |
ACTIONS_STEP_DEBUG: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- { name: Fetch sources, uses: actions/checkout@v4, with: { fetch-depth: 0 } } | |
- { name: Gradle Wrapper Validation, uses: gradle/wrapper-validation-action@v3 } | |
- { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } } | |
- { name: Setup Gradle, uses: gradle/actions/setup-gradle@v3, with: { gradle-home-cache-cleanup: true } } | |
- name: Build plugin | |
run: ./gradlew buildPlugin | |
- { name: Upload `compiled` artifact, uses: actions/upload-artifact@v4, with: { name: compiled, path: build/classes/**/* } } | |
testing: | |
name: Test with coverage | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- { name: Fetch sources, uses: actions/checkout@v4, with: { fetch-depth: 0 } } | |
- { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } } | |
- { name: Setup Gradle, uses: gradle/actions/setup-gradle@v3, with: { gradle-home-cache-cleanup: true } } | |
- { name: Download `compiled`, uses: actions/download-artifact@v4, with: { name: compiled, path: build/classes/ } } | |
- name: Run tests | |
run: ./gradlew check | |
- { name: Upload `junit-report` artifact, uses: actions/upload-artifact@v4, with: { name: junit-report, path: build/reports/junit } } | |
- { name: Upload `jacoco-report` artifact, uses: actions/upload-artifact@v4, with: { name: jacoco-report, path: build/reports/jacoco } } | |
analyse: | |
name: Analyse | |
runs-on: ubuntu-latest | |
needs: [testing] | |
steps: | |
- { name: Fetch sources, uses: actions/checkout@v4, with: { fetch-depth: 0 } } | |
- { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } } | |
- { name: Setup Gradle, uses: gradle/actions/setup-gradle@v3, with: { gradle-home-cache-cleanup: true } } | |
- { name: Download `junit-report`, uses: actions/download-artifact@v4, with: { name: junit-report, path: build/reports/junit } } | |
- { name: Download `jacoco-report`, uses: actions/download-artifact@v4, with: { name: jacoco-report, path: build/reports/jacoco } } | |
- { name: Download `compiled`, uses: actions/download-artifact@v4, with: { name: compiled, path: build/classes/ } } | |
- run: find . | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Run SonarQube analysis with Quality Gates | |
if: github.ref != 'refs/heads/master' | |
run: ./gradlew sonar -Dsonar.branch.name=${{ github.head_ref }} | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Run SonarQube analysis | |
if: github.ref == 'refs/heads/master' | |
run: ./gradlew sonar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_SCANNER_OPTS: "-Dsonar.qualitygate.wait=true -Dsonar.projectVersion=$CI_COMMIT_TAG" | |
verifyPlugin: | |
name: Verify Plugin | |
runs-on: ubuntu-latest | |
needs: [analyse] | |
steps: | |
- { name: Fetch sources, uses: actions/checkout@v4, with: { fetch-depth: 0 } } | |
- { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } } | |
- { name: Setup Gradle, uses: gradle/actions/setup-gradle@v3, with: { gradle-home-cache-cleanup: true } } | |
- name: Run Plugin Verify | |
if: github.ref != 'refs/heads/master' | |
run: ./gradlew runPluginVerifier | |
- { name: Upload `intellij-verification-report` artifact, uses: actions/upload-artifact@v4, with: { name: intellij-verification-report, path: build/reports/pluginVerifier } } |