This is an automated email from the ASF dual-hosted git repository.

aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new c290c5a3 Ensure the compatibility of modifications to the RocketMQ 
Java client code with OpenTelemetry instrumentation (#438)
c290c5a3 is described below

commit c290c5a30423bc1385cf9afd7ca84a5fe601126e
Author: Aaron Ai <[email protected]>
AuthorDate: Sat Apr 1 14:03:14 2023 +0800

    Ensure the compatibility of modifications to the RocketMQ Java client code 
with OpenTelemetry instrumentation (#438)
---
 .github/workflows/java_build.yml | 56 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/java_build.yml b/.github/workflows/java_build.yml
index 9c384eb2..b2f87dfd 100644
--- a/.github/workflows/java_build.yml
+++ b/.github/workflows/java_build.yml
@@ -1,5 +1,5 @@
 name: Java Build
-on: 
+on:
   workflow_call:
 jobs:
   build:
@@ -21,3 +21,57 @@ jobs:
       - name: Build with Maven
         working-directory: ./java
         run: mvn -B package --file pom.xml
+
+  opentelemetry-instrumentation-compatibility:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Current Repository
+        uses: actions/checkout@v2
+      # Use JDK 17.
+      - name: Use JDK 17
+        uses: actions/setup-java@v2
+        with:
+          java-version: 17
+          distribution: "adopt"
+      # Build the code of the current repository, skipping tests and code 
style checks.
+      - name: Build Current Repository
+        working-directory: ./java
+        run: mvn clean install -DskipTests -Dcheckstyle.skip 
-Dspotbugs.skip=true
+      # Get the version of the current repository.
+      - name: Get Current Version
+        id: get_version
+        working-directory: ./java
+        run: echo "::set-output name=version::$(mvn help:evaluate 
-Dexpression=project.version -q -DforceStdout)"
+      # Check the latest release tag of opentelemetry.
+      - name: Check Latest Release Tag
+        id: get_release_tag
+        run: |
+          curl --silent 
"https://api.github.com/repos/open-telemetry/opentelemetry-java-instrumentation/releases/latest";
 \
+            | grep '"tag_name":' \
+            | sed -E 's/.*"([^"]+)".*/\1/' \
+            | xargs echo "::set-output name=tag_name::"
+      # Clone the opentelemetry-java-instrumentation repository.
+      - name: Checkout Latest Release
+        uses: actions/checkout@v2
+        with:
+          repository: open-telemetry/opentelemetry-java-instrumentation
+          ref: ${{ steps.get_release_tag.outputs.tag_name }}
+      # Print the current version.
+      - name: Print Current Version
+        run: |
+          echo "Current Version: ${{ steps.get_version.outputs.version }}"
+      # Replace the RocketMQ client version.
+      - name: Replace RocketMQ Client Version
+        run: |
+          sed -i 
's/org\.apache\.rocketmq:rocketmq-client-java:[^"]*/org.apache.rocketmq:rocketmq-client-java:${{
 steps.get_version.outputs.version }}/' 
instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/build.gradle.kts
+      # Use JDK 17.
+      - name: Use JDK 17
+        uses: actions/setup-java@v2
+        with:
+          java-version: 17
+          distribution: "adopt"
+          cache: gradle
+      # Build the rocketmq opentelemetry test.
+      - name: Build OpenTelemetry Instrumentation Test
+        run: |
+          ./gradlew 
:instrumentation:rocketmq:rocketmq-client:rocketmq-client-5.0:javaagent:test -i

Reply via email to