Repository navigation
ci #23581
Workflow file for this run
This file contains hidden or 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
| # Licensed to the Apache Software Foundation (ASF) under one or more | |
| # contributor license agreements. See the NOTICE file distributed with | |
| # this work for additional information regarding copyright ownership. | |
| # The ASF licenses this file to You under the Apache License, Version 2.0 | |
| # (the "License"); you may not use this file except in compliance with | |
| # the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: ci | |
| run-name: >- | |
| ${{ github.event_name == 'workflow_dispatch' && inputs.release_candidate | |
| && format('Release candidate {0}', inputs.release_dispatch_id) | |
| || github.workflow }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_candidate: | |
| description: Build unsigned release artifacts with Javadocs and legal resources | |
| type: boolean | |
| default: false | |
| release_dispatch_id: | |
| description: Unique release workflow correlation identifier | |
| type: string | |
| required: false | |
| default: '' | |
| # Required checks must report a result even for documentation-only PRs. | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '*.md' | |
| - '**/README*.md' | |
| - 'docs/**' | |
| - '**/docs/**' | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - '.github/PULL_REQUEST_TEMPLATE.md' | |
| concurrency: | |
| # Give every non-PR run its own group, including runs still waiting for a runner. | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| agent_gateway_migrations: | |
| needs: changes | |
| if: github.repository == 'apache/shenyu' && needs.changes.outputs.code == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check Agent Gateway upgrade and schema consistency | |
| run: | | |
| python3 .github/scripts/check-agent-gateway-migrations.py | |
| python3 .github/scripts/test-agent-gateway-migrations.py | |
| changes: | |
| if: github.repository == 'apache/shenyu' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| code: ${{ steps.modules.outputs.has_code_changes }} | |
| code_files: ${{ steps.filter.outputs.code_files }} | |
| rat_required: ${{ steps.filter.outputs.code }} | |
| modules: ${{ steps.modules.outputs.modules }} | |
| full_build_required: ${{ steps.modules.outputs.full_build_required }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Test workflow scope and example image selection | |
| run: | | |
| node --test .github/scripts/test-ci-workflows.mjs | |
| node --test .github/scripts/issue-spec-policy-test.mjs | |
| python3 -B .github/scripts/test-resolve-example-projects.py | |
| python3 -B .github/scripts/test-actions-timings.py | |
| python3 -B .github/scripts/test-restore-shenyu-local-repo.py | |
| python3 -B .github/scripts/test-check-release-artifacts.py | |
| - name: Test CI case resolver | |
| run: bash .github/scripts/resolve-test-case-matrix-test.sh | |
| - name: Test HTTP pool snapshot source provenance | |
| run: python3 script/performance/http-pool/test_snapshot.py | |
| - name: Test HTTP pool benchmark report integrity | |
| run: python3 script/performance/http-pool/test_report.py | |
| - name: Test HTTP pool Java argument files | |
| run: python3 script/performance/http-pool/test_runner.py | |
| - name: Test Maven transfer retries | |
| run: bash .github/scripts/maven-with-retry-test.sh | |
| - name: Test storage Compose healthchecks | |
| run: bash shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/compose-script-test.sh | |
| - name: Test E2E artifact reruns | |
| run: node --test .github/scripts/retest-test.mjs | |
| - uses: ./actions/paths-filter | |
| id: filter | |
| with: | |
| list-files: "json" | |
| predicate-quantifier: every | |
| filters: | | |
| code: | |
| - '**' | |
| - '!.asf.yaml' | |
| - '!.gitignore' | |
| - '!.licenserc.yaml' | |
| - '!LICENSE' | |
| - '!**/LICENSE' | |
| - '!shenyu-*/**/LICENSE' | |
| - '!shenyu-*/**/release-docs/LICENSE' | |
| - '!NOTICE' | |
| - '!**/NOTICE' | |
| - '!shenyu-*/**/NOTICE' | |
| - '!shenyu-*/**/release-docs/NOTICE' | |
| - '!.github/ISSUE_TEMPLATE/**' | |
| - '!*.md' | |
| - '!**/README*.md' | |
| - '!docs/**' | |
| - '!**/docs/**' | |
| - '!.github/PULL_REQUEST_TEMPLATE.md' | |
| - name: Resolve changed Maven modules | |
| id: modules | |
| if: steps.filter.outputs.code == 'true' || github.event_name == 'workflow_dispatch' | |
| env: | |
| CHANGED_FILES_JSON: ${{ github.event_name == 'workflow_dispatch' && '["pom.xml"]' || steps.filter.outputs.code_files }} | |
| run: bash .github/scripts/resolve-ci-modules.sh | |
| - name: Test GHCR publish routing | |
| run: bash .github/scripts/resolve-ghcr-publish-test.sh | |
| registry_dependencies: | |
| needs: changes | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'apache/shenyu' && needs.changes.outputs.code == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: maven | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| - name: Replay registration contract and check resolved client boundaries | |
| run: | | |
| python3 .github/scripts/test-client-boundary.py | |
| python3 .github/scripts/check-client-boundary.py | |
| bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl shenyu-admin,shenyu-spring-boot-starter/shenyu-spring-boot-starter-client/shenyu-spring-boot-starter-client-beat -am package dependency:tree \ | |
| -Dtest=RegistrationProtocolCompatibilityTest,ZookeeperClientDiscoveryIntegrationTest,HeartbeatListenerConfigurationTest \ | |
| -Dsurefire.failIfNoSpecifiedTests=false -DskipRemoteResources=true -Djacoco.skip=true -Dmaven.javadoc.skip=true \ | |
| -Dscope=test -DoutputType=tgf -DoutputFile=target/client-boundary.tgf | |
| python3 .github/scripts/check-client-boundary.py --trees | |
| - name: Check resolved registry dependency boundaries | |
| run: | | |
| python3 .github/scripts/test-registry-dependencies.py | |
| REGISTRY_MODULES="$(python3 .github/scripts/check-registry-dependencies.py --modules)" | |
| bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl "$REGISTRY_MODULES" -am package dependency:tree \ | |
| -DskipTests -DskipRemoteResources=true -Djacoco.skip=true -Dmaven.javadoc.skip=true \ | |
| -Dscope=runtime -DoutputType=tgf -DoutputFile=target/registry-dependencies.tgf | |
| python3 .github/scripts/check-registry-dependencies.py | |
| rat_check: | |
| needs: changes | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'apache/shenyu' && (needs.changes.outputs.rat_required == 'true' || github.event_name == 'workflow_dispatch') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| - name: Run Apache RAT check | |
| run: ./mvnw -B -ntp apache-rat:check | |
| plugin_contract: | |
| needs: [changes] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| if: github.repository == 'apache/shenyu' && needs.changes.outputs.code == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: maven | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| - name: Install the packaged plugin contract kit | |
| run: | | |
| bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl shenyu-web -am install \ | |
| -DskipTests -DskipRemoteResources=true -Djacoco.skip=true -Dmaven.javadoc.skip=true | |
| - name: Test the external plugin contract consumer | |
| run: | | |
| bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp \ | |
| -f shenyu-examples/shenyu-examples-plugin-contract/pom.xml \ | |
| test org.apache.rat:apache-rat-plugin:0.15:check -DfailIfNoTests=true -Djacoco.skip=true | |
| pr_build: | |
| needs: changes | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'apache/shenyu' && github.event_name == 'pull_request' && needs.changes.outputs.code == 'true' && needs.changes.outputs.full_build_required != 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: maven | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| - name: Build with Maven | |
| shell: bash | |
| env: | |
| MODULES: ${{ needs.changes.outputs.modules }} | |
| run: | | |
| module_args=() | |
| if [[ -n "$MODULES" ]]; then | |
| module_args=(-pl "$MODULES" -am) | |
| fi | |
| exec bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -T 1C "${module_args[@]}" test \ | |
| -Prelease -DskipRemoteResources=true -Djacoco.skip=true | |
| build_local_repo: | |
| needs: changes | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'apache/shenyu' && (github.event_name != 'pull_request' || needs.changes.outputs.full_build_required == 'true') && needs.changes.outputs.code == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: maven | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| - name: Build ShenYu local Maven repository | |
| shell: bash | |
| env: | |
| RELEASE_CANDIDATE: ${{ github.event_name == 'workflow_dispatch' && inputs.release_candidate || false }} | |
| run: | | |
| release_args=(-Prelease -Dmaven.javadoc.skip=true -DskipRemoteResources=true) | |
| if [[ "$RELEASE_CANDIDATE" == "true" ]]; then | |
| python3 - <<'PYTHON' | |
| import xml.etree.ElementTree as ET | |
| root = ET.parse('pom.xml').getroot() | |
| version = root.findtext('{http://maven.apache.org/POM/4.0.0}version') | |
| if not version or 'SNAPSHOT' in version: | |
| raise SystemExit('Release candidates require a non-SNAPSHOT project version') | |
| print('Building unsigned release candidate:', version) | |
| PYTHON | |
| release_args=(-Prelease,apache-release -Dmaven.javadoc.skip=false -Dgpg.skip=true -DskipRemoteResources=false) | |
| fi | |
| ./mvnw -B -ntp -T 1C install "${release_args[@]}" -DskipTests \ | |
| -Djacoco.skip=true -Drat.skip=true | |
| mkdir -p /tmp/shenyu-m2 | |
| if [[ "$RELEASE_CANDIDATE" == "true" ]]; then | |
| release_version="$(python3 -c "import xml.etree.ElementTree as E; print(E.parse('pom.xml').getroot().findtext('{http://maven.apache.org/POM/4.0.0}version'))")" | |
| repository_paths=() | |
| for artifact_dir in "${HOME}/.m2/repository/org/apache/shenyu/"*; do | |
| if [[ -d "${artifact_dir}/${release_version}" ]]; then | |
| repository_paths+=("org/apache/shenyu/${artifact_dir##*/}/${release_version}") | |
| fi | |
| done | |
| [[ ${#repository_paths[@]} -gt 0 ]] || { echo "No ${release_version} Maven artifacts found" >&2; exit 1; } | |
| tar -czf /tmp/shenyu-m2/repository.tar.gz -C "${HOME}/.m2/repository" "${repository_paths[@]}" | |
| else | |
| tar -czf /tmp/shenyu-m2/repository.tar.gz -C "${HOME}/.m2/repository" org/apache/shenyu | |
| fi | |
| cp .mvn/wrapper/maven-wrapper.jar /tmp/shenyu-m2/maven-wrapper.jar | |
| - name: Check every candidate Maven JAR and both source distributions | |
| if: github.event_name == 'workflow_dispatch' && inputs.release_candidate | |
| run: python3 .github/scripts/check-release-artifacts.py --repository "${HOME}/.m2/repository/org/apache/shenyu" | |
| - name: Resolve distribution runtime dependencies | |
| run: | | |
| bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl shenyu-admin,shenyu-bootstrap,shenyu-dist/shenyu-admin-dist,shenyu-dist/shenyu-bootstrap-dist dependency:list \ | |
| -DincludeScope=runtime -DoutputFile=target/release-runtime-dependencies.txt | |
| python3 .github/scripts/collect-release-licenses.py | |
| # Fetch the verifier after packaging so its sources cannot enter the source archive. | |
| - name: Check out the pinned ShenYu license verifier | |
| if: github.event_name == 'workflow_dispatch' && inputs.release_candidate | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: apache/shenyu-watcher | |
| ref: 94c1bb95ffc65038ea8be4c15fda5167d8d6b675 | |
| path: .release-tools/shenyu-watcher | |
| - name: Check candidate distribution licenses | |
| if: github.event_name == 'workflow_dispatch' && inputs.release_candidate | |
| shell: bash | |
| run: | | |
| python3 .github/scripts/collect-release-licenses.py --check | |
| audit_root="${RUNNER_TEMP}/shenyu-release-license-audit" | |
| for component in admin bootstrap; do | |
| archives=("shenyu-dist/shenyu-${component}-dist/target/"apache-shenyu-*-"${component}"-bin.tar.gz) | |
| [[ ${#archives[@]} -eq 1 && -f "${archives[0]}" ]] | |
| mkdir -p "${audit_root}/${component}" | |
| tar -xzf "${archives[0]}" -C "${audit_root}/${component}" | |
| distributions=("${audit_root}/${component}/"apache-shenyu-*-"${component}"-bin) | |
| [[ ${#distributions[@]} -eq 1 && -d "${distributions[0]}/lib" ]] | |
| # The verifier CLI prints failures with exit code zero; enforce its result explicitly. | |
| python3 - "${distributions[0]}/lib" "shenyu-dist/shenyu-${component}-dist" "${distributions[0]}/LICENSE" <<'PYTHON' | |
| import importlib.util | |
| import sys | |
| spec = importlib.util.spec_from_file_location('release_watcher', '.release-tools/shenyu-watcher/shenyu_watcher.py') | |
| watcher = importlib.util.module_from_spec(spec) | |
| sys.modules[spec.name] = watcher | |
| spec.loader.exec_module(watcher) | |
| result = watcher.run_check(sys.argv[2], sys.argv[3], lib_dir=sys.argv[1]) | |
| watcher.print_result(result) | |
| if not result.checked or result.unmatched or result.parse_failures: | |
| raise SystemExit('Candidate dependency license declarations are incomplete') | |
| PYTHON | |
| done | |
| - name: Upload distribution runtime dependency reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: shenyu-release-runtime-dependencies | |
| path: | | |
| shenyu-admin/target/release-runtime-dependencies.txt | |
| shenyu-bootstrap/target/release-runtime-dependencies.txt | |
| shenyu-dist/shenyu-admin-dist/target/release-runtime-dependencies.txt | |
| shenyu-dist/shenyu-bootstrap-dist/target/release-runtime-dependencies.txt | |
| target/release-audit/*.json | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Upload ShenYu local Maven repository | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: shenyu-local-maven-repository | |
| path: /tmp/shenyu-m2/ | |
| compression-level: 0 | |
| if-no-files-found: error | |
| retention-days: 1 | |
| source_release_check: | |
| needs: build_local_repo | |
| if: github.repository == 'apache/shenyu' && github.event_name == 'workflow_dispatch' && inputs.release_candidate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: maven | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: shenyu-local-maven-repository | |
| path: /tmp/shenyu-m2 | |
| - name: Restore release artifacts | |
| run: bash .github/scripts/restore-shenyu-local-repo.sh /tmp/shenyu-m2 | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| - name: Rebuild the source distribution and run the complete default reactor tests | |
| shell: bash | |
| run: | | |
| version="$(python3 -c "import xml.etree.ElementTree as E; print(E.parse('pom.xml').getroot().findtext('{http://maven.apache.org/POM/4.0.0}version'))")" | |
| source_archive="${HOME}/.m2/repository/org/apache/shenyu/shenyu-src-dist/${version}/shenyu-src-dist-${version}-src.zip" | |
| source_root="${RUNNER_TEMP}/shenyu-source-check" | |
| mkdir -p "$source_root" | |
| unzip -q "$source_archive" -d "$source_root" | |
| cd "${source_root}/apache-shenyu-${version}-src" | |
| bash "${GITHUB_WORKSPACE}/.github/scripts/ensure-maven-wrapper.sh" | |
| bash "${GITHUB_WORKSPACE}/.github/scripts/maven-with-retry.sh" ./mvnw -B -ntp install -Djacoco.skip=true -Dmaven.javadoc.skip=true | |
| # Repeat the counter synchronization and registry callback regressions after the full source build. | |
| for attempt in {1..10}; do | |
| ./mvnw -B -ntp -pl shenyu-admin test -Dtest=ShenyuClusterServiceTest,ZookeeperClientDiscoveryIntegrationTest -Djacoco.skip=true -Dmaven.javadoc.skip=true | |
| done | |
| python3 - <<'PYTHON' | |
| from pathlib import Path | |
| import re | |
| import zipfile | |
| with zipfile.ZipFile('shenyu-admin/target/shenyu-admin.jar') as jar: | |
| html = jar.read('static/index.html').decode() | |
| for reference in re.findall(r'(?:src|href)=["\x27]([^"\x27]+\.(?:js|css))["\x27]', html): | |
| assert jar.read('static/' + reference.removeprefix('./')), reference | |
| assert 'Apache ShenYu' in jar.read('META-INF/NOTICE').decode() | |
| print('Source-built Admin contains all referenced dashboard JS/CSS and project NOTICE') | |
| PYTHON | |
| - name: Upload source build test evidence | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: shenyu-source-release-validation | |
| path: | | |
| ${{ runner.temp }}/shenyu-source-check/**/target/surefire-reports/*.xml | |
| ${{ runner.temp }}/shenyu-source-check/**/target/rat.txt | |
| if-no-files-found: warn | |
| retention-days: 7 | |
| test_group: | |
| needs: | |
| - changes | |
| - build_local_repo | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'apache/shenyu' && (github.event_name != 'pull_request' || needs.changes.outputs.full_build_required == 'true') && needs.changes.outputs.code == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: core | |
| modules: shenyu-common,shenyu-spi,shenyu-disruptor,shenyu-protocol,shenyu-loadbalancer | |
| - name: gateway-runtime | |
| modules: shenyu-web,shenyu-bootstrap | |
| - name: starters | |
| modules: shenyu-spring-boot-starter,!shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway | |
| - name: starters-agent | |
| modules: shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway | |
| - name: admin | |
| modules: shenyu-admin | |
| - name: sync | |
| modules: shenyu-admin-listener,shenyu-sync-data-center | |
| - name: plugin-base | |
| modules: shenyu-plugin/shenyu-plugin-api,shenyu-plugin/shenyu-plugin-wasm-api,shenyu-plugin/shenyu-plugin-base,shenyu-plugin/shenyu-plugin-wasm-base,shenyu-plugin/shenyu-plugin-httpclient,shenyu-plugin/shenyu-plugin-rewrite,shenyu-plugin/shenyu-plugin-waf,shenyu-plugin/shenyu-plugin-global,shenyu-plugin/shenyu-plugin-context-path,shenyu-plugin/shenyu-plugin-redirect,shenyu-plugin/shenyu-plugin-modify-response,shenyu-plugin/shenyu-plugin-request,shenyu-plugin/shenyu-plugin-response,shenyu-plugin/shenyu-plugin-param-mapping,shenyu-plugin/shenyu-plugin-uri,shenyu-plugin/shenyu-plugin-metrics,shenyu-plugin/shenyu-plugin-tracing,shenyu-plugin/shenyu-plugin-cache,shenyu-plugin/shenyu-plugin-mock | |
| - name: plugin-logging | |
| modules: shenyu-plugin/shenyu-plugin-logging | |
| - name: plugin-proxy | |
| modules: shenyu-plugin/shenyu-plugin-proxy,shenyu-plugin/shenyu-plugin-security,shenyu-plugin/shenyu-plugin-fault-tolerance | |
| - name: plugin-ai | |
| modules: shenyu-plugin/shenyu-plugin-ai,shenyu-plugin/shenyu-plugin-agent-gateway,shenyu-plugin/shenyu-plugin-mcp-server | |
| - name: client-register-registry | |
| modules: shenyu-client,shenyu-register-center,shenyu-registry | |
| - name: dist-extra | |
| modules: shenyu-dist,shenyu-sdk,shenyu-alert,shenyu-kubernetes-controller,shenyu-infra | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: maven | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: shenyu-local-maven-repository | |
| path: /tmp/shenyu-m2 | |
| - name: Restore ShenYu local Maven repository | |
| run: bash .github/scripts/restore-shenyu-local-repo.sh /tmp/shenyu-m2 | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| # The producer already checks main and test source style for the complete reactor. | |
| - name: Run Maven tests | |
| shell: bash | |
| run: | | |
| modules="$(GROUP_ROOTS="${{ matrix.modules }}" bash .github/scripts/expand-ci-module-roots.sh)" | |
| echo "Testing Maven modules: ${modules}" | |
| ./mvnw -B -ntp -T 1C -pl "${modules}" test -Prelease -DskipRemoteResources=true -Dcheckstyle.skip=true | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: ${{ matrix.name }} | |
| compat_java21: | |
| needs: | |
| - changes | |
| - build_local_repo | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'apache/shenyu' && (github.event_name != 'pull_request' || needs.changes.outputs.full_build_required == 'true') && needs.changes.outputs.code == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: core | |
| modules: shenyu-common,shenyu-spi,shenyu-disruptor,shenyu-protocol,shenyu-loadbalancer | |
| - name: gateway-runtime | |
| modules: shenyu-web,shenyu-bootstrap | |
| - name: starters | |
| modules: shenyu-spring-boot-starter,!shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway | |
| - name: starters-agent | |
| modules: shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway | |
| - name: admin | |
| modules: shenyu-admin | |
| - name: sync | |
| modules: shenyu-admin-listener,shenyu-sync-data-center | |
| - name: plugin-base | |
| modules: shenyu-plugin/shenyu-plugin-api,shenyu-plugin/shenyu-plugin-wasm-api,shenyu-plugin/shenyu-plugin-base,shenyu-plugin/shenyu-plugin-wasm-base,shenyu-plugin/shenyu-plugin-httpclient,shenyu-plugin/shenyu-plugin-rewrite,shenyu-plugin/shenyu-plugin-waf,shenyu-plugin/shenyu-plugin-global,shenyu-plugin/shenyu-plugin-context-path,shenyu-plugin/shenyu-plugin-redirect,shenyu-plugin/shenyu-plugin-modify-response,shenyu-plugin/shenyu-plugin-request,shenyu-plugin/shenyu-plugin-response,shenyu-plugin/shenyu-plugin-param-mapping,shenyu-plugin/shenyu-plugin-uri,shenyu-plugin/shenyu-plugin-metrics,shenyu-plugin/shenyu-plugin-tracing,shenyu-plugin/shenyu-plugin-cache,shenyu-plugin/shenyu-plugin-mock | |
| - name: plugin-logging | |
| modules: shenyu-plugin/shenyu-plugin-logging | |
| - name: plugin-proxy | |
| modules: shenyu-plugin/shenyu-plugin-proxy,shenyu-plugin/shenyu-plugin-security,shenyu-plugin/shenyu-plugin-fault-tolerance | |
| - name: plugin-ai | |
| modules: shenyu-plugin/shenyu-plugin-ai,shenyu-plugin/shenyu-plugin-agent-gateway,shenyu-plugin/shenyu-plugin-mcp-server | |
| - name: client-register-registry | |
| modules: shenyu-client,shenyu-register-center,shenyu-registry | |
| - name: dist-extra | |
| modules: shenyu-dist,shenyu-sdk,shenyu-alert,shenyu-kubernetes-controller,shenyu-infra | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: ./actions/setup-java-with-retry | |
| with: | |
| java-version: "21" | |
| distribution: "temurin" | |
| cache: maven | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: shenyu-local-maven-repository | |
| path: /tmp/shenyu-m2 | |
| - name: Restore ShenYu local Maven repository | |
| run: bash .github/scripts/restore-shenyu-local-repo.sh /tmp/shenyu-m2 | |
| - name: Ensure Maven wrapper JAR | |
| run: bash .github/scripts/ensure-maven-wrapper.sh | |
| # Reuse the producer's Checkstyle result; preserve all Java 21 test execution. | |
| - name: Run Java 21 compatibility tests | |
| shell: bash | |
| run: | | |
| modules="$(GROUP_ROOTS="${{ matrix.modules }}" bash .github/scripts/expand-ci-module-roots.sh)" | |
| ./mvnw -B -ntp -T 1C -pl "${modules}" test -Prelease -DskipRemoteResources=true -Dcheckstyle.skip=true -Djacoco.skip=true | |
| - name: Repeat actual HTTP cancellation and peer isolation on Java 21 | |
| if: github.event_name == 'workflow_dispatch' && inputs.release_candidate && matrix.name == 'plugin-ai' | |
| run: | | |
| for attempt in {1..10}; do | |
| ./mvnw -B -ntp -pl shenyu-plugin/shenyu-plugin-agent-gateway test -Dtest=RemoteResourceNetworkTest \ | |
| -Prelease -DskipRemoteResources=true -Dcheckstyle.skip=true -Djacoco.skip=true | |
| done | |
| check-license-header: | |
| name: check-license-header | |
| needs: changes | |
| if: github.repository == 'apache/shenyu' && (needs.changes.outputs.rat_required == 'true' || github.event_name == 'workflow_dispatch') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Check License Header | |
| uses: apache/skywalking-eyes@a196742f472feaffafea537ce5a2a4c3c53a8de4 # v0.9.0; supports REM headers in Windows batch files | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| requirement: | |
| name: build | |
| if: github.repository == 'apache/shenyu' && !cancelled() | |
| needs: | |
| - changes | |
| - rat_check | |
| - agent_gateway_migrations | |
| - registry_dependencies | |
| - plugin_contract | |
| - check-license-header | |
| - pr_build | |
| - build_local_repo | |
| - test_group | |
| - compat_java21 | |
| - source_release_check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checking job status | |
| run: | | |
| [[ "${{ needs.changes.result }}" == "success" ]] || exit 1 | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.release_candidate }}" == "true" ]]; then | |
| [[ "${{ needs.source_release_check.result }}" == "success" ]] || exit 1 | |
| fi | |
| if [[ "${{ needs.changes.outputs.code }}" == "true" ]]; then | |
| [[ "${{ needs.registry_dependencies.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.plugin_contract.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.agent_gateway_migrations.result }}" == "success" ]] || exit 1 | |
| fi | |
| if [[ "${{ needs.changes.outputs.rat_required }}" == "true" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| [[ "${{ needs.rat_check.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.check-license-header.result }}" == "success" ]] || exit 1 | |
| fi | |
| if [[ "${{ needs.changes.outputs.code }}" == "true" && "${{ github.event_name }}" == "pull_request" && "${{ needs.changes.outputs.full_build_required }}" != "true" ]]; then | |
| [[ "${{ needs.pr_build.result }}" == "success" ]] || exit 1 | |
| fi | |
| if [[ "${{ needs.changes.outputs.code }}" == "true" && ("${{ github.event_name }}" != "pull_request" || "${{ needs.changes.outputs.full_build_required }}" == "true") ]]; then | |
| [[ "${{ needs.build_local_repo.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.test_group.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.compat_java21.result }}" == "success" ]] || exit 1 | |
| fi |