Skip to content

Commit d132b1b

Browse files
yuneng-berriclaude
andauthored
[Infra] Remove Redundant Matrix Unit Test Workflow (#25251)
* Remove redundant matrix unit test workflow All test paths in test-litellm-matrix.yml are fully covered by the newer semantic unit test workflows (test-unit-*.yml), making the matrix workflow redundant CI spend. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add Codecov coverage reporting to semantic unit test workflows Add coverage collection (--cov) and Codecov OIDC upload to both reusable base workflows and all 12 caller workflows, replacing the coverage reporting that was previously only in the matrix workflow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Move id-token/pull-requests permissions to job level for multi-job workflows For workflows with multiple jobs (llm-providers, proxy-db), move id-token: write and pull-requests: write from workflow level to job level so permissions are scoped to only the jobs that need them. Removes zizmor inline suppressions that were masking the issue. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d2d99aa commit d132b1b

15 files changed

+144
-217
lines changed

.github/workflows/_test-unit-base.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ on:
2727
required: false
2828
type: number
2929
default: 10
30+
artifact-name:
31+
description: "Unique name for the coverage artifact (must be unique per run)"
32+
required: true
33+
type: string
3034

3135
permissions:
3236
contents: read
@@ -93,4 +97,46 @@ jobs:
9397
--reruns "${RERUNS}" \
9498
--reruns-delay 1 \
9599
--dist=loadscope \
96-
--durations=20
100+
--durations=20 \
101+
--cov=litellm \
102+
--cov-report=xml:coverage.xml \
103+
--cov-config=pyproject.toml
104+
105+
- name: Save coverage report
106+
if: always()
107+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
108+
with:
109+
name: coverage-${{ inputs.artifact-name }}-${{ github.run_id }}-${{ github.run_attempt }}
110+
path: coverage.xml
111+
retention-days: 1
112+
113+
upload-coverage:
114+
name: Upload coverage to Codecov
115+
needs: run
116+
if: always()
117+
runs-on: ubuntu-latest
118+
permissions:
119+
contents: read
120+
id-token: write
121+
pull-requests: write
122+
123+
steps:
124+
- name: Checkout code
125+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
126+
with:
127+
persist-credentials: false
128+
129+
- name: Download coverage report
130+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
131+
with:
132+
pattern: coverage-${{ inputs.artifact-name }}-${{ github.run_id }}-${{ github.run_attempt }}
133+
path: coverage-reports
134+
merge-multiple: true
135+
136+
- name: Upload to Codecov
137+
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
138+
with:
139+
use_oidc: true
140+
directory: coverage-reports
141+
root_dir: ${{ github.workspace }}
142+
fail_ci_if_error: false

.github/workflows/_test-unit-services-base.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ on:
3737
required: false
3838
type: boolean
3939
default: false
40+
artifact-name:
41+
description: "Unique name for the coverage artifact (must be unique per run)"
42+
required: false
43+
type: string
44+
default: "run"
4045
secrets:
4146
REDIS_HOST:
4247
required: false
@@ -151,7 +156,10 @@ jobs:
151156
--maxfail="${MAX_FAILURES}" \
152157
--reruns "${RERUNS}" \
153158
--reruns-delay 1 \
154-
--durations=20
159+
--durations=20 \
160+
--cov=litellm \
161+
--cov-report=xml:coverage.xml \
162+
--cov-config=pyproject.toml
155163
else
156164
poetry run pytest ${TEST_PATH:?} \
157165
--tb=short -vv \
@@ -160,5 +168,47 @@ jobs:
160168
--reruns "${RERUNS}" \
161169
--reruns-delay 1 \
162170
--dist=loadscope \
163-
--durations=20
171+
--durations=20 \
172+
--cov=litellm \
173+
--cov-report=xml:coverage.xml \
174+
--cov-config=pyproject.toml
164175
fi
176+
177+
- name: Save coverage report
178+
if: always()
179+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
180+
with:
181+
name: coverage-${{ inputs.artifact-name }}-${{ github.run_id }}-${{ github.run_attempt }}
182+
path: coverage.xml
183+
retention-days: 1
184+
185+
upload-coverage:
186+
name: Upload coverage to Codecov
187+
needs: run
188+
if: always()
189+
runs-on: ubuntu-latest
190+
permissions:
191+
contents: read
192+
id-token: write
193+
pull-requests: write
194+
195+
steps:
196+
- name: Checkout code
197+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
198+
with:
199+
persist-credentials: false
200+
201+
- name: Download coverage report
202+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
203+
with:
204+
pattern: coverage-${{ inputs.artifact-name }}-${{ github.run_id }}-${{ github.run_attempt }}
205+
path: coverage-reports
206+
merge-multiple: true
207+
208+
- name: Upload to Codecov
209+
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
210+
with:
211+
use_oidc: true
212+
directory: coverage-reports
213+
root_dir: ${{ github.workspace }}
214+
fail_ci_if_error: false

.github/workflows/test-litellm-matrix.yml

Lines changed: 0 additions & 214 deletions
This file was deleted.

.github/workflows/test-unit-caching-redis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88

99
permissions:
1010
contents: read
11+
id-token: write
12+
pull-requests: write
1113

1214
concurrency:
1315
group: ${{ github.workflow }}-${{ github.ref }}
@@ -29,6 +31,7 @@ jobs:
2931
timeout-minutes: 20
3032
enable-redis: true
3133
enable-postgres: false
34+
artifact-name: caching-redis
3235
secrets:
3336
REDIS_HOST: ${{ secrets.REDIS_HOST }}
3437
REDIS_PORT: ${{ secrets.REDIS_PORT }}

.github/workflows/test-unit-core-utils.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66

77
permissions:
88
contents: read
9+
id-token: write
10+
pull-requests: write
911

1012
concurrency:
1113
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -18,3 +20,4 @@ jobs:
1820
test-path: "tests/test_litellm/litellm_core_utils"
1921
workers: 2
2022
reruns: 1
23+
artifact-name: core-utils

.github/workflows/test-unit-enterprise-routing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66

77
permissions:
88
contents: read
9+
id-token: write
10+
pull-requests: write
911

1012
concurrency:
1113
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -22,3 +24,4 @@ jobs:
2224
tests/test_litellm/router_strategy
2325
workers: 2
2426
reruns: 2
27+
artifact-name: enterprise-routing

0 commit comments

Comments
 (0)