@@ -57,10 +57,12 @@ jobs:
57
57
run : |
58
58
uv sync --group testing --all-extras
59
59
60
+ - run : mkdir coverage
61
+
60
62
- name : test
61
63
run : make test
62
64
env :
63
- COVERAGE_FILE : .coverage.${{ runner.os }}-py${{ matrix.python }}
65
+ COVERAGE_FILE : coverage/ .coverage.${{ runner.os }}-py${{ matrix.python }}
64
66
CONTEXT : ${{ runner.os }}-py${{ matrix.python }}
65
67
66
68
- name : uninstall deps
@@ -69,20 +71,63 @@ jobs:
69
71
- name : test without deps
70
72
run : make test
71
73
env :
72
- COVERAGE_FILE : .coverage.${{ runner.os }}-py${{ matrix.python }}-without-deps
74
+ COVERAGE_FILE : coverage/ .coverage.${{ runner.os }}-py${{ matrix.python }}-without-deps
73
75
CONTEXT : ${{ runner.os }}-py${{ matrix.python }}-without-deps
74
76
75
- - run : uv run coverage combine
76
- - run : uv run coverage xml
77
-
78
- - uses : codecov/codecov-action@v4
77
+ - name : store coverage files
78
+ uses : actions/upload-artifact@v4
79
79
with :
80
- file : ./coverage.xml
81
- env_vars : PYTHON,OS
80
+ name : coverage-${{ matrix.python }}-${{ runner.os }}
81
+ path : coverage
82
+ include-hidden-files : true
83
+
84
+ coverage :
85
+ runs-on : ubuntu-latest
86
+ needs : [test]
87
+ steps :
88
+ - uses : actions/checkout@v4
89
+ with :
90
+ # needed for diff-cover
91
+ fetch-depth : 0
92
+
93
+ - name : get coverage files
94
+ uses : actions/download-artifact@v4
95
+ with :
96
+ merge-multiple : true
97
+ path : coverage
98
+
99
+ - uses : astral-sh/setup-uv@v5
100
+ with :
101
+ enable-cache : true
102
+
103
+ - run : uv sync --group testing --all-extras
104
+
105
+ - run : uv run coverage combine coverage
106
+
107
+ - run : uv run coverage html --show-contexts --title "Pydantic Settings coverage for ${{ github.sha }}"
108
+
109
+ - name : Store coverage html
110
+ uses : actions/upload-artifact@v4
111
+ with :
112
+ name : coverage-html
113
+ path : htmlcov
114
+ include-hidden-files : true
115
+
116
+ - run : uv run coverage xml
117
+
118
+ - run : uv run diff-cover coverage.xml --html-report index.html
119
+
120
+ - name : Store diff coverage html
121
+ uses : actions/upload-artifact@v4
122
+ with :
123
+ name : diff-coverage-html
124
+ path : index.html
125
+
126
+ - run : uv run coverage report --fail-under 98
82
127
83
128
check : # This job does nothing and is only used for the branch protection
84
129
if : always()
85
- needs : [lint, test]
130
+ needs : [lint, test, coverage ]
86
131
runs-on : ubuntu-latest
87
132
88
133
outputs :
0 commit comments