You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo "Covered lines: $COVERED, Total lines: $TOTAL, Coverage: $FE_VALUE%"
209
+
echo "export COVERED=$COVERED" >> "$BASH_ENV"
210
+
echo "export TOTAL=$TOTAL" >> "$BASH_ENV"
211
+
echo "export FE_VALUE=$FE_VALUE" >> "$BASH_ENV"
212
+
- run:
213
+
name: Load previous frontend coverage value
214
+
when: always
215
+
command: |
216
+
if [ -f fe_coverage.csv ]; then
217
+
PREV_FE=$(python -c 'import csv; f=open("fe_coverage.csv", newline=""); r=csv.reader(f); next(r, None); rows=[float(row[0]) for row in r if row and row[0]]; print(f"{rows[-1]:.2f}" if rows else "98.7")')
218
+
else
219
+
PREV_FE=98.7
220
+
fi
221
+
echo "Previous value: $PREV_FE%"
222
+
echo "export PREV_FE_VALUE=$PREV_FE" >> $BASH_ENV
223
+
- run:
224
+
name: Compare frontend coverage value
225
+
when: always
226
+
command: |
227
+
if [ -z "$COVERAGE_AVAILABLE" ]; then
228
+
echo "skipping"
229
+
exit 0
230
+
fi
231
+
percent_change=$(python -c 'import os; fe=float(os.environ.get("FE_VALUE","0") or 0); prev=float(os.environ.get("PREV_FE_VALUE","0") or 0); print("n/a" if prev==0 else f"{((fe-prev)/prev)*100:.2f}")')
percent_change=$(python -c 'import os; fps=float(os.environ.get("FPS_VALUE","0") or 0); prev=float(os.environ.get("PREV_VALUE","0") or 0); print("n/a" if prev==0 else f"{((fps-prev)/prev)*100:.2f}")')
artifact_url=$(printf "%s" "$artifacts_json" | python -c 'import json,sys; data=json.load(sys.stdin); items=data.get("items") or []; print(items[0].get("url","") if items else "")')
391
+
artifact_url=$(printf "%s" "$artifacts_json" | python -c 'import json,sys; data=json.load(sys.stdin); items=data.get("items") or []; print(next((item.get("url","") for item in items if item.get("url","").endswith(".png")), ""))')
0 commit comments