Optimize code and improve readability #650
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tagtransmission integration test | |
env: | |
sermantVersion: 1.0.0 | |
on: | |
push: | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- 'sermant-agentcore/**' | |
- 'sermant-integration-tests/tag-transmission-test/**' | |
- 'sermant-plugins/sermant-tag-transmission/**' | |
- '.github/workflows/tagtransmission_integration_test.yml' | |
- '.github/actions/common/tag-transmission/**' | |
- '.github/actions/scenarios/tag-transmission/**' | |
- '.github/actions/common/plugin-change-check/action.yml' | |
- '.github/actions/common/entry/action.yml' | |
- '.github/actions/common/exit/action.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
set-execution-conditions: | |
name: set-execution-conditions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: plugin-change-check | |
id: plugin-change-check | |
uses: ./.github/actions/common/plugin-change-check | |
- name: set-outputs | |
id: set-outputs | |
run: | | |
echo "enableHttpclientV3TagTransmissionAction=${{env.enableHttpclientV3TagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableHttpclientV4TagTransmissionAction=${{env.enableHttpclientV4TagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableOkhttpTagTransmissionAction=${{env.enableOkhttpTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableGrpcTagTransmissionAction=${{env.enableGrpcTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableSofarpcTagTransmissionAction=${{env.enableSofarpcTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableServicecombTagTransmissionAction=${{env.enableServicecombTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableAlibabaDubboTagTransmissionAction=${{env.enableAlibabaDubboTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableApacheDubboTagTransmissionAction=${{env.enableApacheDubboTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableCrossthreadTagTransmissionAction=${{env.enableCrossthreadTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableConfigTagTransmissionAction=${{env.enableConfigTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableKafkaTagTransmissionAction=${{env.enableKafkaTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableRocketmqTagTransmissionAction=${{env.enableRocketmqTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableJettyTagTransmissionAction=${{env.enableJettyTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
echo "enableTomcatTagTransmissionAction=${{env.enableTomcatTagTransmissionAction}}" >> $GITHUB_OUTPUT | |
outputs: | |
enableHttpclientV3TagTransmissionAction: ${{ steps.set-outputs.outputs.enableHttpclientV3TagTransmissionAction }} | |
enableHttpclientV4TagTransmissionAction: ${{ steps.set-outputs.outputs.enableHttpclientV4TagTransmissionAction }} | |
enableOkhttpTagTransmissionAction: ${{ steps.set-outputs.outputs.enableOkhttpTagTransmissionAction }} | |
enableGrpcTagTransmissionAction: ${{ steps.set-outputs.outputs.enableGrpcTagTransmissionAction }} | |
enableSofarpcTagTransmissionAction: ${{ steps.set-outputs.outputs.enableSofarpcTagTransmissionAction }} | |
enableServicecombTagTransmissionAction: ${{ steps.set-outputs.outputs.enableServicecombTagTransmissionAction }} | |
enableAlibabaDubboTagTransmissionAction: ${{ steps.set-outputs.outputs.enableAlibabaDubboTagTransmissionAction }} | |
enableApacheDubboTagTransmissionAction: ${{ steps.set-outputs.outputs.enableApacheDubboTagTransmissionAction }} | |
enableCrossthreadTagTransmissionAction: ${{ steps.set-outputs.outputs.enableCrossthreadTagTransmissionAction }} | |
enableConfigTagTransmissionAction: ${{ steps.set-outputs.outputs.enableConfigTagTransmissionAction }} | |
enableKafkaTagTransmissionAction: ${{ steps.set-outputs.outputs.enableKafkaTagTransmissionAction }} | |
enableRocketmqTagTransmissionAction: ${{ steps.set-outputs.outputs.enableRocketmqTagTransmissionAction }} | |
enableJettyTagTransmissionAction: ${{ steps.set-outputs.outputs.enableJettyTagTransmissionAction }} | |
enableTomcatTagTransmissionAction: ${{ steps.set-outputs.outputs.enableTomcatTagTransmissionAction }} | |
download-midwares-and-cache: | |
name: download midwares and cache | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: cache local cse | |
uses: actions/cache@v4 | |
with: | |
path: Local-CSE-2.1.3-linux-amd64.zip | |
key: ${{ runner.os }}-local-cse | |
restore-keys: | | |
${{ runner.os }}-local-cse | |
- name: download cse | |
run: | | |
export ROOT_PATH=$(pwd) | |
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh cse | |
- name: cache zookeeper | |
uses: actions/cache@v4 | |
with: | |
path: apache-zookeeper-3.6.3-bin.tar.gz | |
key: ${{ runner.os }}-apache-zookeeper-3.6.3 | |
restore-keys: | | |
${{ runner.os }}-apache-zookeeper-3.6.3 | |
- name: download zookeeper | |
run: | | |
export ROOT_PATH=$(pwd) | |
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh zk | |
- name: cache nacos server | |
uses: actions/cache@v4 | |
with: | |
path: nacos-server-1.4.2.tar.gz | |
key: ${{ runner.os }}-nacos-server-1.4.2 | |
restore-keys: | | |
${{ runner.os }}-nacos-server-1.4.2 | |
- name: download nacos | |
run: | | |
export ROOT_PATH=$(pwd) | |
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh nacos | |
- name: cache rocketmq | |
uses: actions/cache@v4 | |
with: | |
path: rocketmq-all-4.8.0-bin-release.zip | |
key: ${{ runner.os }}-rocketmq-all-4.8.0-bin-release | |
restore-keys: | | |
${{ runner.os }}-rocketmq-all-4.8.0-bin-release | |
- name: download rocketmq | |
run: | | |
export ROOT_PATH=$(pwd) | |
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh rocketmq | |
- name: cache kafka | |
uses: actions/cache@v4 | |
with: | |
path: kafka_2.13-2.7.0.tgz | |
key: ${{ runner.os }}-kafka_2.13-2.7.0 | |
restore-keys: | | |
${{ runner.os }}-kafka_2.13-2.7.0 | |
- name: download kafka | |
run: | | |
export ROOT_PATH=$(pwd) | |
bash ./sermant-integration-tests/scripts/tryDownloadMidware.sh kafka | |
build-agent-and-cache: | |
name: build agent and cache | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
cache: maven | |
- name: cache agent | |
uses: actions/cache@v4 | |
with: | |
path: sermant-agent-*/ | |
key: ${{ runner.os }}-agent-${{ github.run_id }} | |
- name: package agent | |
run: | | |
sed -i '/sermant-backend/d' pom.xml | |
sed -i '/sermant-integration-tests/d' pom.xml | |
sed -i '/sermant-injector/d' pom.xml | |
sed -i '/sermant-flowcontrol/d' sermant-plugins/pom.xml | |
mvn package -DskipTests -Ptest --file pom.xml | |
test-for-tag-transmission-httpclientv3: | |
name: Test for tag transmission httpclientv3 | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableHttpclientV3TagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- httpClientVersion: "3.0.1" | |
- httpClientVersion: "3.1" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for httpClientVersion=${{ matrix.httpClientVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/httpclientv3 | |
test-for-tag-transmission-httpclientv4: | |
name: Test for tag transmission httpclientv4 | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableHttpclientV4TagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- httpClientVersion: "4.3.6" | |
- httpClientVersion: "4.4.1" | |
- httpClientVersion: "4.5.14" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for httpClientVersion=${{ matrix.httpClientVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/httpclientv4 | |
test-for-tag-transmission-okhttp: | |
name: Test for tag transmission okhttp | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableOkhttpTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- okHttpVersion: "2.0.0" | |
- okHttpVersion: "2.1.0" | |
- okHttpVersion: "2.2.0" | |
- okHttpVersion: "2.3.0" | |
- okHttpVersion: "2.4.0" | |
- okHttpVersion: "2.5.0" | |
- okHttpVersion: "2.6.0" | |
- okHttpVersion: "2.7.5" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for okHttpVersion=${{ matrix.okHttpVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/okhttp | |
test-for-tag-transmission-grpc: | |
name: Test for tag transmission grpc | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableGrpcTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- grpcVersion: "1.13.1" | |
- grpcVersion: "1.21.0" | |
- grpcVersion: "1.26.0" | |
- grpcVersion: "1.31.0" | |
- grpcVersion: "1.37.0" | |
- grpcVersion: "1.42.2" | |
- grpcVersion: "1.49.0" | |
- grpcVersion: "1.52.1" | |
- grpcVersion: "1.58.0" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for grpcVersion=${{ matrix.grpcVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/grpc | |
test-for-tag-transmission-sofarpc: | |
name: Test for tag transmission sofarpc | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableSofarpcTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- sofaRpcVersion: "5.3.4" | |
- sofaRpcVersion: "5.4.8" | |
- sofaRpcVersion: "5.5.9" | |
- sofaRpcVersion: "5.6.5" | |
- sofaRpcVersion: "5.7.10" | |
- sofaRpcVersion: "5.8.8" | |
- sofaRpcVersion: "5.9.2" | |
- sofaRpcVersion: "5.10.0" | |
- sofaRpcVersion: "5.11.1" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for sofaRpcVersion=${{ matrix.sofaRpcVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/sofarpc | |
test-for-tag-transmission-servicecomb: | |
name: Test for tag transmission servicecomb | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableServicecombTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- serviceCombVersion: "2.1.6" | |
- serviceCombVersion: "2.2.4" | |
- serviceCombVersion: "2.3.6" | |
- serviceCombVersion: "2.5.3" | |
- serviceCombVersion: "2.6.3" | |
- serviceCombVersion: "2.7.10" | |
- serviceCombVersion: "2.8.12" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for servicecombVersion=${{ matrix.serviceCombVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/servicecomb | |
test-for-tag-transmission-alibabadubbo: | |
name: Test for tag transmission alibabadubbo | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableAlibabaDubboTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- alibabaDubboVersion: "2.6.0" | |
- alibabaDubboVersion: "2.6.3" | |
- alibabaDubboVersion: "2.6.6" | |
- alibabaDubboVersion: "2.6.9" | |
- alibabaDubboVersion: "2.6.12" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for alibabaDubboVersion=${{ matrix.alibabaDubboVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/alibaba-dubbo | |
test-for-tag-transmission-apachedubbo: | |
name: Test for tag transmission apachedubbo | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableApacheDubboTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- apacheDubboVersion: "2.7.5" | |
- apacheDubboVersion: "2.7.15" | |
- apacheDubboVersion: "2.7.23" | |
- apacheDubboVersion: "3.0.15" | |
- apacheDubboVersion: "3.1.11" | |
- apacheDubboVersion: "3.2.7" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for apacheDubboVersion=${{ matrix.apacheDubboVersion}} | |
uses: ./.github/actions/scenarios/tag-transmission/apache-dubbo | |
test-for-tag-transmission-crossthread: | |
name: Test for tag transmission crossthread | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableCrossthreadTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for crossthread | |
uses: ./.github/actions/scenarios/tag-transmission/crossthread | |
test-for-tag-transmission-config: | |
name: Test for tag transmission config | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableConfigTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for config | |
uses: ./.github/actions/scenarios/tag-transmission/config | |
test-for-tag-transmission-kafka: | |
name: Test for tag transmission kafka | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableKafkaTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- kafkaVersion: "2.3.1" | |
- kafkaVersion: "1.1.1" | |
- kafkaVersion: "2.7.2" | |
- kafkaVersion: "3.4.0" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for kafkaVersion=${{ matrix.kafkaVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/kafka | |
test-for-tag-transmission-rocketmq: | |
name: Test for tag transmission rocketmq | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableRocketmqTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- rocketMqVersion: "4.9.7" | |
- rocketMqVersion: "5.0.0" | |
- rocketMqVersion: "5.1.4" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for rocketMqVersion=${{ matrix.rocketMqVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/rocketmq | |
test-for-tag-transmission-jdkhttp-jetty: | |
name: Test for tag transmission jdkhttp and jetty | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableJettyTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- springBootVersion: "1.0.2.RELEASE" | |
- springBootVersion: "1.1.12.RELEASE" | |
- springBootVersion: "1.3.8.RELEASE" | |
- springBootVersion: "1.4.7.RELEASE" | |
- springBootVersion: "1.5.22.RELEASE" | |
- springBootVersion: "2.2.0.RELEASE" | |
- springBootVersion: "2.4.13" | |
- springBootVersion: "2.7.16" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for springBootVersion=${{ matrix.springBootVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/jdkhttp-jetty | |
test-for-tag-transmission-jdkhttp-tomcat: | |
name: Test for tag transmission jdkhttp and tomcat | |
runs-on: ubuntu-latest | |
if: needs.set-execution-conditions.outputs.enableTomcatTagTransmissionAction=='true' | |
needs: [set-execution-conditions, build-agent-and-cache, download-midwares-and-cache] | |
strategy: | |
matrix: | |
include: | |
- springBootVersion: "1.0.2.RELEASE" | |
- springBootVersion: "1.1.12.RELEASE" | |
- springBootVersion: "1.3.8.RELEASE" | |
- springBootVersion: "1.4.7.RELEASE" | |
- springBootVersion: "1.5.22.RELEASE" | |
- springBootVersion: "2.2.0.RELEASE" | |
- springBootVersion: "2.4.13" | |
- springBootVersion: "2.7.16" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: set java version to environment | |
run: | | |
echo "javaVersion=8" >> $GITHUB_ENV | |
- name: common operations | |
uses: ./.github/actions/common/tag-transmission | |
- name: tag transmission test for springBootVersion=${{ matrix.springBootVersion }} | |
uses: ./.github/actions/scenarios/tag-transmission/jdkhttp-tomcat |