diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 196e908..0fd0d6d 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -23,22 +23,29 @@ jobs: build: runs-on: ubuntu-latest timeout-minutes: 30 - strategy: matrix: java: [21] distribution: [temurin] - steps: - uses: actions/checkout@v5 - + - name: Set up JDK uses: actions/setup-java@v5 with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} - cache: 'gradle' - + + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-build- + - name: Build run: ./gradlew build buildPlugin --info --stacktrace @@ -48,7 +55,7 @@ jobs: with: name: test-reports-${{ matrix.java }} path: build/reports/tests/test/** - + - name: Check for uncommited changes run: | if [[ "$(git status --porcelain)" != "" ]]; then @@ -78,21 +85,28 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} timeout-minutes: 15 - strategy: matrix: java: [21] distribution: [temurin] - steps: - uses: actions/checkout@v5 - + - name: Set up JDK uses: actions/setup-java@v5 with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} - cache: 'gradle' + + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-checkstyle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-checkstyle- - name: Run Checkstyle run: ./gradlew checkstyleMain checkstyleTest -PcheckstyleEnabled --stacktrace @@ -101,25 +115,32 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} timeout-minutes: 15 - strategy: matrix: java: [21] distribution: [temurin] - steps: - uses: actions/checkout@v5 - + - name: Set up JDK uses: actions/setup-java@v5 with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} - cache: 'gradle' - name: Run PMD run: ./gradlew pmdMain pmdTest -PpmdEnabled --stacktrace + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-pmd-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-pmd- + - name: Upload report if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/check-ide-compatibility.yml b/.github/workflows/check-ide-compatibility.yml index 2d52b0b..5f18107 100644 --- a/.github/workflows/check-ide-compatibility.yml +++ b/.github/workflows/check-ide-compatibility.yml @@ -2,7 +2,7 @@ name: Check IDE Compatibility on: schedule: - - cron: '55 2 * * 1' + - cron: '55 8 * * 1' workflow_dispatch: jobs: @@ -36,13 +36,23 @@ jobs: sudo df -h - uses: actions/checkout@v5 - + - name: Set up JDK uses: actions/setup-java@v5 with: distribution: 'temurin' java-version: 21 - + + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-ide-compatibility-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-ide-compatibility- + - name: Check compatibility run: ./gradlew verifyPlugin --info --stacktrace diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a457478..666cccd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,17 +14,26 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v5 - + - name: Set up JDK uses: actions/setup-java@v5 with: java-version: '21' distribution: 'temurin' - cache: 'gradle' + + - name: Try restore Gradle Cache + uses: actions/cache/restore@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-build- - name: Build run: ./gradlew build buildPlugin --info --stacktrace - + - name: Check for uncommited changes run: | if [[ "$(git status --porcelain)" != "" ]]; then @@ -51,12 +60,12 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - uses: actions/checkout@v5 - + - name: Configure Git run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - + - name: UN-Snap version and output id: version run: | @@ -71,7 +80,7 @@ jobs: echo "Contents of gradle.properties" cat gradle.properties - + - name: Commit and Push run: | git add -A @@ -79,7 +88,7 @@ jobs: git push origin git tag v${{ steps.version.outputs.release }} git push origin --tags - + - name: Create Release id: create_release uses: shogo82148/actions-create-release@4661dc54f7b4b564074e9fbf73884d960de569a3 # v1 @@ -104,20 +113,19 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@v5 - + - name: Set up JDK uses: actions/setup-java@v5 with: distribution: 'temurin' java-version: 21 - cache: 'gradle' - + - name: Init Git and pull run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git pull - + - name: Publish Plugin env: PUBLISH_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_PUBLISH_TOKEN }} @@ -138,20 +146,20 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v5 - + - name: Init Git and pull run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git pull - + - name: Inc Version and SNAP root run: | originalVersion=$(grep -Po 'pluginVersion=\K.*' gradle.properties) newVersion="$(echo $originalVersion | cut -d '-' -f1 | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')-SNAPSHOT" echo "New version: $newVersion" sed -i "s/pluginVersion=$originalVersion/pluginVersion=$newVersion/" gradle.properties - + echo "Contents of gradle.properties" cat gradle.properties @@ -160,7 +168,7 @@ jobs: git add -A git commit -m "Preparing for next development iteration" git push origin - + - name: pull-request env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 84f46a9..3bb2621 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -15,8 +15,7 @@ jobs: with: distribution: 'temurin' java-version: 21 - cache: 'gradle' - + - name: Update/Generify version run: | originalVersion=$(grep -Po 'pluginVersion=\K.*' gradle.properties) @@ -26,7 +25,7 @@ jobs: echo "Contents of gradle.properties" cat gradle.properties - + - name: Publish Plugin env: PUBLISH_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_PUBLISH_TOKEN }} diff --git a/build.gradle b/build.gradle index 161dfcf..c074684 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'idea' id 'checkstyle' id 'pmd' - id 'org.jetbrains.intellij.platform' version '2.8.0' + id 'org.jetbrains.intellij.platform' version '2.9.0' } ext {