]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✅ Expand test matrix to include Windows and MacOS (#14171)
authorSofie Van Landeghem <svlandeg@users.noreply.github.com>
Thu, 11 Dec 2025 15:28:21 +0000 (20:58 +0530)
committerGitHub <noreply@github.com>
Thu, 11 Dec 2025 15:28:21 +0000 (16:28 +0100)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
.github/workflows/test.yml
pyproject.toml

index 8157e364bae379c5ce7e2612b75a9d0ad432224b..94b3fbd9c62c6377a416c3bdb18e3069f3124766 100644 (file)
@@ -44,22 +44,44 @@ jobs:
         run: bash scripts/lint.sh
 
   test:
-    runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version:
-          - "3.14"
-          - "3.13"
-          - "3.12"
-          - "3.11"
-          - "3.10"
-          - "3.9"
-          - "3.8"
-        pydantic-version: ["pydantic-v1", "pydantic-v2"]
-        exclude:
-          - python-version: "3.14"
+        os: [ ubuntu-latest, windows-latest, macos-latest ]
+        python-version: [ "3.14" ]
+        pydantic-version: [ "pydantic-v2" ]
+        coverage: ["coverage"]
+        include:
+          - os: macos-latest
+            python-version: "3.8"
+            pydantic-version: "pydantic-v1"
+            coverage: coverage
+          - os: windows-latest
+            python-version: "3.8"
+            pydantic-version: "pydantic-v2"
+            coverage: coverage
+          - os: ubuntu-latest
+            python-version: "3.9"
+            pydantic-version: "pydantic-v1"
+            coverage: coverage
+          - os: macos-latest
+            python-version: "3.10"
+            pydantic-version: "pydantic-v2"
+          - os: windows-latest
+            python-version: "3.11"
+            pydantic-version: "pydantic-v1"
+          - os: ubuntu-latest
+            python-version: "3.12"
+            pydantic-version: "pydantic-v2"
+          - os: macos-latest
+            python-version: "3.13"
             pydantic-version: "pydantic-v1"
+            coverage: coverage
+          - os: windows-latest
+            python-version: "3.13"
+            pydantic-version: "pydantic-v2"
+            coverage: coverage
       fail-fast: false
+    runs-on: ${{ matrix.os }}
     steps:
       - name: Dump GitHub context
         env:
@@ -96,10 +118,12 @@ jobs:
         env:
           COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
           CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
+      # Do not store coverage for all possible combinations to avoid file size max errors in Smokeshow
       - name: Store coverage files
+        if: matrix.coverage == 'coverage'
         uses: actions/upload-artifact@v5
         with:
-          name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
+          name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
           path: coverage
           include-hidden-files: true
 
index f8d5fa7c7ac9effb50c3222d429acbe7f6cc555f..ef4440b1b4f7af95a5476988f4096a58554a6931 100644 (file)
@@ -196,6 +196,7 @@ source = [
     "tests",
     "fastapi"
 ]
+relative_files = true
 context = '${CONTEXT}'
 dynamic_context = "test_function"
 omit = [