diff --git a/.github/workflows/caffeine-use-snapshot.gradle.kts b/.github/workflows/caffeine-use-snapshot.gradle.kts new file mode 100644 index 0000000000..0ef5d34e74 --- /dev/null +++ b/.github/workflows/caffeine-use-snapshot.gradle.kts @@ -0,0 +1,23 @@ +// An init script to override Caffeine's build configuration to use a snapshot version of NullAway +allprojects { + repositories { + mavenCentral() + mavenLocal() + gradlePluginPortal() + } +} + +gradle.projectsLoaded { + rootProject.allprojects { + configurations.all { + resolutionStrategy { + eachDependency { + if (requested.group == "com.uber.nullaway") { + useVersion("+") + } + } + cacheChangingModulesFor(0, "seconds") + } + } + } +} diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fcb2fb1602..f0d6658111 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -76,3 +76,30 @@ jobs: if: matrix.java == '17' - name: Check that Git tree is clean after build and test run: ./.buildscript/check_git_clean.sh + caffeine-gradle-task: + name: "Build Caffeine with snapshot" + runs-on: ubuntu-latest + + steps: + - name: Checkout this repository + uses: actions/checkout@v4 + - name: 'Set up JDKs' + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Publish to Maven Local + env: + ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: 'false' + run: ./gradlew publishToMavenLocal + - name: Create a temporary directory for Caffeine + run: mkdir -p /tmp/caffeine + - name: Clone Caffeine repository + run: git clone --depth 1 https://github.com/ben-manes/caffeine.git /tmp/caffeine + - name: Run caffeine build + run: | + cp .github/workflows/caffeine-use-snapshot.gradle.kts /tmp/caffeine + cd /tmp/caffeine + ./gradlew --init-script caffeine-use-snapshot.gradle.kts build -x test -x javadoc