"...ssh:/git@developer.sourcefind.cn:2222/OpenDAS/dynamo.git" did not exist on "dcbccbcd2ea52d5a0762eb5834718af00317c8e6"
Unverified Commit 0b0879dd authored by KrishnanPrash's avatar KrishnanPrash Committed by GitHub
Browse files

ci: run scoped mypy on backend-only PRs (#7636)


Signed-off-by: default avatarKrishnan Prashanth <kprashanth@nvidia.com>
parent 98d0ce91
...@@ -29,6 +29,9 @@ jobs: ...@@ -29,6 +29,9 @@ jobs:
core: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.core == 'true' }} core: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.core == 'true' }}
planner: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.planner == 'true' }} planner: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.planner == 'true' }}
frontend: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.frontend == 'true' }} frontend: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.frontend == 'true' }}
sglang: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.sglang == 'true' }}
vllm: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.vllm == 'true' }}
trtllm: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') || steps.changes.outputs.trtllm == 'true' }}
builder_name: ${{ steps.export-builder-name.outputs.builder_name }} builder_name: ${{ steps.export-builder-name.outputs.builder_name }}
steps: steps:
- name: Checkout code - name: Checkout code
...@@ -56,7 +59,13 @@ jobs: ...@@ -56,7 +59,13 @@ jobs:
build: build:
needs: changed-files needs: changed-files
if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.planner == 'true' || needs.changed-files.outputs.frontend == 'true' if: >-
needs.changed-files.outputs.core == 'true' ||
needs.changed-files.outputs.planner == 'true' ||
needs.changed-files.outputs.frontend == 'true' ||
needs.changed-files.outputs.sglang == 'true' ||
needs.changed-files.outputs.vllm == 'true' ||
needs.changed-files.outputs.trtllm == 'true'
runs-on: prod-builder-v3 runs-on: prod-builder-v3
name: Build name: Build
timeout-minutes: 60 timeout-minutes: 60
...@@ -188,7 +197,13 @@ jobs: ...@@ -188,7 +197,13 @@ jobs:
mypy: mypy:
needs: [changed-files, build] needs: [changed-files, build]
if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.planner == 'true' || needs.changed-files.outputs.frontend == 'true' if: >-
needs.changed-files.outputs.core == 'true' ||
needs.changed-files.outputs.planner == 'true' ||
needs.changed-files.outputs.frontend == 'true' ||
needs.changed-files.outputs.sglang == 'true' ||
needs.changed-files.outputs.vllm == 'true' ||
needs.changed-files.outputs.trtllm == 'true'
runs-on: prod-builder-amd-v1 runs-on: prod-builder-amd-v1
name: Mypy name: Mypy
timeout-minutes: 15 timeout-minutes: 15
...@@ -211,7 +226,23 @@ jobs: ...@@ -211,7 +226,23 @@ jobs:
docker run --rm -w /workspace \ docker run --rm -w /workspace \
--name mypy_${{ github.run_id }}_${{ github.run_attempt }} \ --name mypy_${{ github.run_id }}_${{ github.run_attempt }} \
${{ env.IMAGE_TAG }} \ ${{ env.IMAGE_TAG }} \
bash -c 'MYPYPATH=components/src:lib/bindings/python/src mypy --explicit-package-bases components/src/dynamo && MYPYPATH=lib/bindings/python/src mypy -p dynamo' bash -c '
MYPYPATH=components/src:lib/bindings/python/src
# Always check shared (non-backend) code
TARGETS=$(find components/src/dynamo -maxdepth 1 -mindepth 1 -type d ! -name sglang ! -name vllm ! -name trtllm | sort | tr "\n" " ")
# Add only the backends that changed
${{ needs.changed-files.outputs.sglang == 'true' && 'TARGETS="$TARGETS components/src/dynamo/sglang"' || ':' }}
${{ needs.changed-files.outputs.vllm == 'true' && 'TARGETS="$TARGETS components/src/dynamo/vllm"' || ':' }}
${{ needs.changed-files.outputs.trtllm == 'true' && 'TARGETS="$TARGETS components/src/dynamo/trtllm"' || ':' }}
MYPYPATH=$MYPYPATH mypy --explicit-package-bases $TARGETS
'
docker run --rm -w /workspace \
--name mypy_bindings_${{ github.run_id }}_${{ github.run_attempt }} \
${{ env.IMAGE_TAG }} \
bash -c 'MYPYPATH=lib/bindings/python/src mypy -p dynamo'
test-parallel: test-parallel:
needs: [changed-files, build, mypy] needs: [changed-files, build, mypy]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment