|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 | +# contributor license agreements. See the NOTICE file distributed with |
| 3 | +# this work for additional information regarding copyright ownership. |
| 4 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 | +# (the "License"); you may not use this file except in compliance with |
| 6 | +# the License. You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +name: minimal-http |
| 17 | +on: |
| 18 | + pull_request: |
| 19 | + paths: |
| 20 | + - 'pom.xml' |
| 21 | + - 'shenyu-bootstrap-http/**' |
| 22 | + - 'shenyu-common/**' |
| 23 | + - 'shenyu-admin/**' |
| 24 | + - 'shenyu-admin-listener/**' |
| 25 | + - 'shenyu-dist/**' |
| 26 | + - 'shenyu-web/**' |
| 27 | + - 'shenyu-plugin/**' |
| 28 | + - 'shenyu-spring-boot-starter/**' |
| 29 | + - 'shenyu-sync-data-center/**' |
| 30 | + - 'shenyu-loadbalancer/**' |
| 31 | + - 'shenyu-spi/**' |
| 32 | + - 'script/performance/minimal-http/**' |
| 33 | + - '.github/workflows/minimal-http.yml' |
| 34 | + - '.github/scripts/resolve-ci-modules.sh' |
| 35 | + - '.github/scripts/test-minimal-http-routing.sh' |
| 36 | + workflow_dispatch: |
| 37 | + |
| 38 | +permissions: |
| 39 | + contents: read |
| 40 | + |
| 41 | +jobs: |
| 42 | + packaged-smoke: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + timeout-minutes: 30 |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + - uses: actions/setup-java@v4 |
| 48 | + with: |
| 49 | + distribution: temurin |
| 50 | + java-version: '17' |
| 51 | + cache: maven |
| 52 | + - uses: actions/setup-python@v5 |
| 53 | + with: |
| 54 | + python-version: '3.12' |
| 55 | + - name: Resolve archive version |
| 56 | + id: version |
| 57 | + run: echo "version=$(./mvnw -q -N -DforceStdout help:evaluate -Dexpression=project.version)" >> "$GITHUB_OUTPUT" |
| 58 | + - name: Build opt-in assembly with Checkstyle and RAT |
| 59 | + run: | |
| 60 | + bash .github/scripts/test-minimal-http-routing.sh |
| 61 | + ./mvnw -B -Pminimal-http -pl shenyu-bootstrap-http -am clean install -DskipTests -Dmaven.javadoc.skip=true -Djacoco.skip=true |
| 62 | + - name: Record resolved runtime dependencies |
| 63 | + run: ./mvnw -B -Pminimal-http -pl shenyu-bootstrap-http dependency:list -DincludeScope=runtime -DoutputFile=target/runtime-dependencies.txt |
| 64 | + - name: Check harness and packaged routing |
| 65 | + env: |
| 66 | + SHENYU_VERSION: ${{ steps.version.outputs.version }} |
| 67 | + run: | |
| 68 | + python -m pip install -r script/performance/minimal-http/requirements.txt |
| 69 | + python -m unittest discover -s script/performance/minimal-http -p 'test_*.py' |
| 70 | + python script/performance/minimal-http/benchmark.py \ |
| 71 | + --minimal "shenyu-bootstrap-http/target/apache-shenyu-http-${SHENYU_VERSION}-bin/apache-shenyu-http" \ |
| 72 | + --java "$JAVA_HOME/bin/java" --smoke-only \ |
| 73 | + --output shenyu-bootstrap-http/target/smoke |
| 74 | + - name: Build disposable Admin and test real centrally synchronized routes |
| 75 | + env: |
| 76 | + SHENYU_VERSION: ${{ steps.version.outputs.version }} |
| 77 | + run: | |
| 78 | + ./mvnw -B -Prelease -pl shenyu-dist/shenyu-admin-dist -am package -DskipTests -Dmaven.javadoc.skip=true -Djacoco.skip=true |
| 79 | + tar -xzf "shenyu-dist/shenyu-admin-dist/target/apache-shenyu-${SHENYU_VERSION}-admin-bin.tar.gz" -C shenyu-dist/shenyu-admin-dist/target |
| 80 | + python script/performance/minimal-http/admin_smoke.py \ |
| 81 | + --admin "shenyu-dist/shenyu-admin-dist/target/apache-shenyu-${SHENYU_VERSION}-admin-bin" \ |
| 82 | + --minimal "shenyu-bootstrap-http/target/apache-shenyu-http-${SHENYU_VERSION}-bin/apache-shenyu-http" \ |
| 83 | + --java "$JAVA_HOME/bin/java" --output shenyu-bootstrap-http/target/admin-smoke |
| 84 | + - uses: actions/upload-artifact@v4 |
| 85 | + if: always() |
| 86 | + with: |
| 87 | + name: minimal-http-package-and-smoke |
| 88 | + path: | |
| 89 | + shenyu-bootstrap-http/target/*-bin.tar.gz |
| 90 | + shenyu-bootstrap-http/target/runtime-dependencies.txt |
| 91 | + shenyu-bootstrap-http/target/smoke/ |
| 92 | + shenyu-bootstrap-http/target/admin-smoke/ |
0 commit comments