#!/bin/sh
# CI 公共步骤：Job 结束计时统计
set +eu
if [ -n "$JOB_START_TIME" ]; then
  END_TIME=$(date +%s)
  DURATION=$((END_TIME - JOB_START_TIME))
  MINS=$((DURATION / 60))
  SECS=$((DURATION % 60))
  echo "JOB_DURATION_SECONDS=$DURATION" >> $GITHUB_ENV
  echo "=== Job Duration: ${MINS}m${SECS}s ==="
else
  echo "JOB_DURATION_SECONDS=0" >> $GITHUB_ENV
  echo "=== Job Duration: unknown ==="
fi
