File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed
Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 7979 else
8080 echo "color=critical" >> $GITHUB_OUTPUT
8181 fi
82-
82+
83+ - name : Upload coverage artifact
84+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
85+ uses : actions/upload-artifact@v3
86+ with :
87+ name : coverage-data
88+ path : |
89+ coverage_quick.xml
90+ retention-days : 1
91+
92+ update-badge :
93+ needs : tests-with-vcr
94+ runs-on : ubuntu-latest
95+ steps :
96+ - name : Download coverage artifact
97+ uses : actions/download-artifact@v3
98+ with :
99+ name : coverage-data
100+
101+ - name : Extract coverage
102+ id : get_coverage
103+ run : |
104+ COVERAGE=$(python -c "import xml.etree.ElementTree as ET; print(round(float(ET.parse('coverage_quick.xml').getroot().attrib['line-rate'])*100))")
105+ echo "percentage=$COVERAGE" >> $GITHUB_OUTPUT
106+ # Determine badge color based on coverage percentage
107+ if [ $COVERAGE -ge 80 ]; then
108+ echo "color=success" >> $GITHUB_OUTPUT
109+ elif [ $COVERAGE -ge 60 ]; then
110+ echo "color=yellow" >> $GITHUB_OUTPUT
111+ else
112+ echo "color=critical" >> $GITHUB_OUTPUT
113+ fi
114+
83115 - name : Update coverage badge
84116 uses : schneegans/dynamic-badges-action@v1.7.0
85117 with :
You can’t perform that action at this time.
0 commit comments