Skip to content

Commit

Permalink
Ensure the compatibility of modifications to the RocketMQ Java client…
Browse files Browse the repository at this point in the history
… code with OpenTelemetry instrumentation (#438)
  • Loading branch information
aaron-ai committed Apr 1, 2023
1 parent 444ed58 commit c290c5a
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion .github/workflows/java_build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Java Build
on:
on:
workflow_call:
jobs:
build:
Expand All @@ -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

0 comments on commit c290c5a

Please sign in to comment.