Skip to content

Commit

Permalink
233 - Revamp of caching using cache new refresh APIs. (#165) (#166)
Browse files Browse the repository at this point in the history
This commit includes refactoring and updates to align the package search API with the new version. The use of NitriteKtorCache has been removed, and additional built-in tests have been added. The caching mechanism and application settings have been improved for better performance. Also, the package structure and build settings have been adjusted accordingly.

(cherry picked from commit 995b4e2)

Co-authored-by: Lamberto Basti <[email protected]>
  • Loading branch information
lamba92 and Lamberto Basti authored May 22, 2024
1 parent ac223d3 commit 5af6fda
Show file tree
Hide file tree
Showing 75 changed files with 42,085 additions and 17,310 deletions.
75 changes: 71 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Run tests
on:
pull_request:
branches: [ releases/233 ]

jobs:
gradle:
strategy:
Expand All @@ -12,6 +13,9 @@ jobs:
gradle-version: [ '5.6.4', '6.9.2', '7.6.4', '8.6' ]
name: Gradle ${{ matrix.gradle-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }}
MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }}
outputs:
result: ${{ steps.final_step.outputs.result }}
steps:
Expand All @@ -30,7 +34,7 @@ jobs:
GRADLE_VERSION: ${{ matrix.gradle-version }}
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
JAVA_VERSION: ${{matrix.jdk-version}}
run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.projectservice.GradleProjectTest"
run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.GradleProjectTest"
- name: Upload test result
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -44,6 +48,9 @@ jobs:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Maven on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }}
MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -59,7 +66,7 @@ jobs:
KMP: true
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
JAVA_VERSION: ${{matrix.jdk-version}}
run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.projectservice.MavenProjectTest"
run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.MavenProjectTest"
- name: Upload test result
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -74,6 +81,46 @@ jobs:
gradle-version: [ '6.9.2', '7.6.4', '8.6' ]
name: KMP ${{ matrix.gradle-version }}
runs-on: ${{ matrix.os }}
env:
MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }}
MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }}
outputs:
result: ${{ steps.final_step.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: gradle/gradle-build-action@v3
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Run tests
env:
KMP: true
GRADLE_VERSION: ${{ matrix.gradle-version }}
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
JAVA_VERSION: ${{matrix.jdk-version}}
run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.KMPGradleProjectTest"
- name: Upload test result
if: always()
uses: actions/upload-artifact@v4
with:
name: testResult-kmp-gradle-${{ matrix.os }}-${{ matrix.gradle-version }}
path: /home/runner/work/package-search-intellij-plugin/package-search-intellij-plugin/plugin/build/testData
version-catalog:
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
gradle-version: [ '7.6.4', '8.6' ]
name: Version Catalog ${{ matrix.gradle-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }}
MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }}
outputs:
result: ${{ steps.final_step.outputs.result }}
steps:
Expand All @@ -92,10 +139,30 @@ jobs:
GRADLE_VERSION: ${{ matrix.gradle-version }}
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
JAVA_VERSION: ${{matrix.jdk-version}}
run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.projectservice.KMPGradleProjectTest"
run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.CatalogProjectTest"
- name: Upload test result
if: always()
uses: actions/upload-artifact@v4
with:
name: testResult-kmp-${{ matrix.os }}-${{ matrix.gradle-version }}
name: testResult-version-catalog-${{ matrix.os }}-${{ matrix.gradle-version }}
path: /home/runner/work/package-search-intellij-plugin/package-search-intellij-plugin/plugin/build/testData
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
env:
MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }}
MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: gradle/gradle-build-action@v3
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Run tests
env:
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
run: ./gradlew :plugin:utils:test
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "nitrite-java"]
path = nitrite-java
url = https://github.com/lamba92/nitrite-java.git
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ allprojects {
maven("https://packages.jetbrains.team/maven/p/kpm/public")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
maven("https://packages.jetbrains.team/maven/p/ij/intellij-sdk-nightly") {
credentials {
username = getenv("MAVEN_SPACE_USERNAME")
?: project.extra.getStringOrNull("space.intellij.username")
password = getenv("MAVEN_SPACE_PASSWORD")
?: project.extra.getStringOrNull("space.intellij.password")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fun Project.configureGradleIntellijPlugin(packageSearchExtension: PackageSearchE

plugins.withId("org.jetbrains.intellij") {
extensions.withType<IntelliJPluginExtension> {
version = "2023.3"
version = "2023.3.6"
instrumentCode = false
downloadSources = !isCI
}
Expand Down
1 change: 1 addition & 0 deletions nitrite-java
Submodule nitrite-java added at be77b1
51 changes: 0 additions & 51 deletions nitrite/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5af6fda

Please sign in to comment.