From 263c9236a050e86041dcb6fd14e50d36a295003c Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Tue, 29 Jul 2025 04:05:19 -0700 Subject: [PATCH] Always trigger pr-test (#8527) --- .github/workflows/pr-test.yml | 85 +++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 28 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 4f6540102..cf1398c36 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -3,18 +3,8 @@ name: PR Test on: push: branches: [ main ] - paths: - - "python/**" - - "scripts/**" - - "test/**" - - ".github/workflows/pr-test.yml" pull_request: branches: [ main ] - paths: - - "python/**" - - "scripts/**" - - "test/**" - - ".github/workflows/pr-test.yml" workflow_dispatch: inputs: version: @@ -31,9 +21,30 @@ concurrency: cancel-in-progress: true jobs: + check-changes: + runs-on: ubuntu-latest + outputs: + src: ${{ steps.filter.outputs.src }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Detect file changes + id: filter + uses: dorny/paths-filter@v3 + with: + filters: | + src: + - "python/**" + - "scripts/**" + - "test/**" + - ".github/workflows/pr-test.yml" + unit-test-frontend: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 1-gpu-runner steps: - name: Checkout code @@ -50,8 +61,10 @@ jobs: python3 run_suite.py --suite per-commit unit-test-backend-1-gpu: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 1-gpu-runner strategy: fail-fast: false @@ -72,8 +85,10 @@ jobs: python3 run_suite.py --suite per-commit --auto-partition-id ${{ matrix.part }} --auto-partition-size 10 unit-test-backend-2-gpu: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 2-gpu-runner steps: - name: Checkout code @@ -90,9 +105,10 @@ jobs: python3 run_suite.py --suite per-commit-2-gpu unit-test-backend-4-gpu: + needs: [check-changes, unit-test-frontend, unit-test-backend-2-gpu] if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false - needs: [unit-test-frontend, unit-test-backend-2-gpu] + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 4-gpu-runner steps: - name: Checkout code @@ -109,9 +125,10 @@ jobs: python3 run_suite.py --suite per-commit-4-gpu unit-test-backend-8-gpu: + needs: [check-changes, unit-test-frontend, unit-test-backend-2-gpu] if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false - needs: [unit-test-frontend, unit-test-backend-2-gpu] + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 8-gpu-runner strategy: fail-fast: false @@ -132,8 +149,10 @@ jobs: python3 run_suite.py --suite per-commit-8-gpu --auto-partition-id ${{ matrix.part }} --auto-partition-size 2 performance-test-1-gpu-part-1: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 1-gpu-runner steps: - name: Checkout code @@ -182,8 +201,10 @@ jobs: python3 -m unittest test_bench_serving.TestBenchServing.test_lora_online_latency_with_concurrent_adapter_updates performance-test-1-gpu-part-2: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 1-gpu-runner steps: - name: Checkout code @@ -224,8 +245,10 @@ jobs: python3 -m unittest test_bench_serving.TestBenchServing.test_vlm_online_latency performance-test-2-gpu: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 2-gpu-runner steps: - name: Checkout code @@ -272,8 +295,10 @@ jobs: python3 -m unittest test_bench_serving.TestBenchServing.test_pp_long_context_prefill accuracy-test-1-gpu: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 1-gpu-runner steps: - name: Checkout code @@ -293,8 +318,10 @@ jobs: python3 test_eval_accuracy_large.py accuracy-test-2-gpu: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 2-gpu-runner steps: - name: Checkout code @@ -314,8 +341,10 @@ jobs: python3 test_moe_eval_accuracy_large.py unit-test-deepep-4-gpu: + needs: check-changes if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 4-gpu-runner steps: - name: Checkout code @@ -332,12 +361,11 @@ jobs: python3 run_suite.py --suite per-commit-4-gpu-deepep unit-test-deepep-8-gpu: + needs: [check-changes, unit-test-deepep-4-gpu] if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && + needs.check-changes.outputs.src == 'true' runs-on: 8-gpu-runner - needs: [ - unit-test-deepep-4-gpu, - ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -353,12 +381,13 @@ jobs: python3 run_suite.py --suite per-commit-8-gpu-deepep pr-test-finish: - if: always() needs: [ + check-changes, unit-test-frontend, unit-test-backend-1-gpu, unit-test-backend-2-gpu, unit-test-backend-4-gpu, unit-test-backend-8-gpu, performance-test-1-gpu-part-1, performance-test-1-gpu-part-2, performance-test-2-gpu, accuracy-test-1-gpu, accuracy-test-2-gpu, unit-test-deepep-4-gpu, unit-test-deepep-8-gpu, ] + if: needs.check-changes.outputs.src == 'true' runs-on: ubuntu-latest steps: - name: Check all dependent job statuses