Skip to content

Commit 677eb5f

Browse files
committed
fix time
1 parent 65aca11 commit 677eb5f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,16 @@ jobs:
9898
[ -z "$executed" ] && executed=$((passed+failed))
9999
skipped=$((total-executed))
100100
101-
duration=$(grep -oP 'duration="\K[0-9\.]+' "$path" | head -1)
101+
local rd
102+
rd=$(grep -oP 'runDuration="\K[^"]+' "$path" | head -1)
103+
if [ -n "$rd" ]; then
104+
duration=$(echo "$rd" | awk -F: '{ sub(/\..*/, "", $3); print $1*3600 + $2*60 + $3 }')
105+
fi
102106
103107
if [ -z "$duration" ]; then
104-
local rd h m s
105-
rd=$(grep -oP 'runDuration="\K[0-9:.]+' "$path" | head -1)
108+
rd=$(grep -oP 'duration="\K[^"]+' "$path" | head -1)
106109
if [ -n "$rd" ]; then
107-
IFS=: read -r h m s <<<"${rd%%.*}"
108-
duration=$((10#$h*3600 + 10#$m*60 + 10#$s))
110+
duration=$(echo "$rd" | awk -F: '{ sub(/\..*/, "", $3); print $1*3600 + $2*60 + $3 }')
109111
fi
110112
fi
111113

0 commit comments

Comments
 (0)