2828 steps :
2929 - uses : actions/checkout@v6
3030 # For pull requests it's not necessary to checkout the code but for the main branch it is
31- - uses : dorny/paths-filter@v3
31+ - uses : dorny/paths-filter@v4
3232 id : filter
3333 with :
3434 filters : |
4545 test :
4646 needs :
4747 - changes
48- if : needs.changes.outputs.src == 'true'
48+ if : needs.changes.outputs.src == 'true' || github.ref == 'refs/heads/master'
4949 strategy :
5050 matrix :
5151 os : [ windows-latest, macos-latest ]
6868 python-version : " 3.13"
6969 coverage : coverage
7070 uv-resolution : highest
71- # Ubuntu with 3.13 needs coverage for CodSpeed benchmarks
7271 - os : ubuntu-latest
7372 python-version : " 3.13"
74- coverage : coverage
7573 uv-resolution : highest
7674 codspeed : codspeed
7775 - os : ubuntu-latest
@@ -109,29 +107,52 @@ jobs:
109107 run : uv pip install "git+https://github.com/Kludex/starlette@main"
110108 - run : mkdir coverage
111109 - name : Test
112- if : matrix.codspeed != 'codspeed'
113- run : uv run --no-sync bash scripts/test.sh
110+ run : uv run --no-sync bash scripts/test-cov.sh
114111 env :
115112 COVERAGE_FILE : coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
116113 CONTEXT : ${{ runner.os }}-py${{ matrix.python-version }}
117- - name : CodSpeed benchmarks
118- if : matrix.codspeed == 'codspeed'
119- uses : CodSpeedHQ/action@v4
120- env :
121- COVERAGE_FILE : coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
122- CONTEXT : ${{ runner.os }}-py${{ matrix.python-version }}
123- with :
124- mode : simulation
125- run : uv run --no-sync coverage run -m pytest tests/ --codspeed
126114 # Do not store coverage for all possible combinations to avoid file size max errors in Smokeshow
127115 - name : Store coverage files
128116 if : matrix.coverage == 'coverage'
129- uses : actions/upload-artifact@v6
117+ uses : actions/upload-artifact@v7
130118 with :
131119 name : coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/coverage/.coverage.*') }}
132120 path : coverage
133121 include-hidden-files : true
134122
123+ benchmark :
124+ needs :
125+ - changes
126+ if : needs.changes.outputs.src == 'true' || github.ref == 'refs/heads/master'
127+ runs-on : ubuntu-latest
128+ env :
129+ UV_PYTHON : " 3.13"
130+ UV_RESOLUTION : highest
131+ steps :
132+ - name : Dump GitHub context
133+ env :
134+ GITHUB_CONTEXT : ${{ toJson(github) }}
135+ run : echo "$GITHUB_CONTEXT"
136+ - uses : actions/checkout@v6
137+ - name : Set up Python
138+ uses : actions/setup-python@v6
139+ with :
140+ python-version : " 3.13"
141+ - name : Setup uv
142+ uses : astral-sh/setup-uv@v7
143+ with :
144+ enable-cache : true
145+ cache-dependency-glob : |
146+ pyproject.toml
147+ uv.lock
148+ - name : Install Dependencies
149+ run : uv sync --no-dev --group tests --extra all
150+ - name : CodSpeed benchmarks
151+ uses : CodSpeedHQ/action@v4
152+ with :
153+ mode : simulation
154+ run : uv run --no-sync pytest tests/benchmarks --codspeed
155+
135156 coverage-combine :
136157 needs :
137158 - test
@@ -155,7 +176,7 @@ jobs:
155176 - name : Install Dependencies
156177 run : uv sync --locked --no-dev --group tests --extra all
157178 - name : Get coverage files
158- uses : actions/download-artifact@v7
179+ uses : actions/download-artifact@v8
159180 with :
160181 pattern : coverage-*
161182 path : coverage
@@ -164,7 +185,7 @@ jobs:
164185 - run : uv run coverage combine coverage
165186 - run : uv run coverage html --title "Coverage for ${{ github.sha }}"
166187 - name : Store coverage HTML
167- uses : actions/upload-artifact@v6
188+ uses : actions/upload-artifact@v7
168189 with :
169190 name : coverage-html
170191 path : htmlcov
@@ -176,6 +197,7 @@ jobs:
176197 if : always()
177198 needs :
178199 - coverage-combine
200+ - benchmark
179201 runs-on : ubuntu-latest
180202 steps :
181203 - name : Dump GitHub context
@@ -186,4 +208,4 @@ jobs:
186208 uses : re-actors/alls-green@release/v1
187209 with :
188210 jobs : ${{ toJSON(needs) }}
189- allowed-skips : coverage-combine,test
211+ allowed-skips : coverage-combine,test,benchmark
0 commit comments