Skip to content

Commit

Permalink
Removing if clause for patch depedencies for release branch only and …
Browse files Browse the repository at this point in the history
…adding maven cache in pr buid for faster build
  • Loading branch information
PaurushGarg committed Dec 20, 2023
1 parent 203cbaa commit 6463dde
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
testpatch:
name: Test patches applied to dependencies
runs-on: aws-otel-java-instrumentation_ubuntu-latest_32-core
if: ${{ startsWith(github.ref_name, 'release/v') }}
if: ${{ hashFiles('.github/patches/**/opentelemetry-java-*.patch') != ''}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

- name: Publish patched dependencies to maven local
uses: ./.github/actions/patch-dependencies
if: ${{ startsWith(github.ref_name, 'release/v') }}
if: ${{ hashFiles('.github/patches/**/opentelemetry-java-*.patch') != ''}}
with:
branch: ${{ github.ref_name }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,17 @@ jobs:

- uses: gradle/wrapper-validation-action@v1

# 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
if: ${{ startsWith(github.event.pull_request.base.ref, 'release/v') }}
if: ${{ hashFiles('.github/patches/**/opentelemetry-java-*.patch') != ''}}
with:
branch: ${{ github.event.pull_request.base.ref }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
Expand Down

0 comments on commit 6463dde

Please sign in to comment.