From f2c2868f1d4f93568bd46bbac44962b9458f4476 Mon Sep 17 00:00:00 2001 From: bryan-aguilar <46550959+bryan-aguilar@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:28:24 -0700 Subject: [PATCH] [release/v1.28.x] Cache maven local (#489) * Cache maven local * cache maven local at PR build time * Update caching steps * Only cache patch outputs --- .github/workflows/main-build.yml | 16 ++++++++++++++++ .github/workflows/pr-build.yml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index f84fbe6ee..87ce01ffe 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -60,6 +60,14 @@ jobs: with: java-version: 17 distribution: temurin + + # cache local patch outputs + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: | + ~/.m2/repository/io/opentelemetry/ + key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/**/opentelemetry-java-*.patch') }} - name: Publish patched dependencies to maven local uses: ./.github/actions/patch-dependencies @@ -308,6 +316,14 @@ jobs: java-version: 17 distribution: temurin + # cache local patch outputs + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: | + ~/.m2/repository/io/opentelemetry/ + key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/**/opentelemetry-java-*.patch') }} + - uses: gradle/wrapper-validation-action@v1 - name: Configure AWS Credentials diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index fc7f51ea6..6b93f27d1 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -25,6 +25,14 @@ jobs: with: node-version: 16 + # cache local patch outputs + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: | + ~/.m2/repository/io/opentelemetry/ + key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/**/opentelemetry-java-*.patch') }} + # vaadin tests use pnpm - name: Cache pnpm modules uses: actions/cache@v3 @@ -65,6 +73,14 @@ jobs: java-version: 17 distribution: temurin + # cache local patch outputs + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: | + ~/.m2/repository/io/opentelemetry/ + key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/**/opentelemetry-java-*.patch') }} + - uses: gradle/wrapper-validation-action@v1 - name: Publish patched dependencies to maven local