Skip to content

Bump JetBrains/qodana-action from 2024.3.2 to 2024.3.3 #495

Bump JetBrains/qodana-action from 2024.3.2 to 2024.3.3

Bump JetBrains/qodana-action from 2024.3.2 to 2024.3.3 #495

Workflow file for this run

name: Build + SonarCloud Analysis
on:
push:
branches:
- master
- release/**
- sonar/**
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Analyse with SonarCloud
runs-on: ubuntu-latest
if: (github.actor != 'dependabot[bot]')
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/[email protected]
- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
cache: gradle
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew listProductsReleases buildPlugin
- name: Test and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew jacocoTestReport sonar --info
# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
- name: Cleanup Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -fr ~/.gradle/caches/*/plugin-resolution/
rm -fr ~/.gradle/caches/modules-2/files-*/com.jetbrains.intellij.idea/
rm -fr ~/.gradle/caches/modules-2/metadata-*/descriptors/com.jetbrains.intellij.idea/