diff --git a/.github/workflows/tf-acc-test.yaml b/.github/workflows/tf-acc-test.yaml index 1debe335..5f699efe 100644 --- a/.github/workflows/tf-acc-test.yaml +++ b/.github/workflows/tf-acc-test.yaml @@ -44,6 +44,7 @@ jobs: id: start_time run: | echo "time=$(date --rfc-3339=ns)" >> ${GITHUB_ENV} + echo "start=$(date +%s%N)" >> ${GITHUB_ENV} - name: Notify uses: ./.github/actions/notify @@ -94,6 +95,12 @@ jobs: id: end_time run: | echo "time=$(date --rfc-3339=ns)" >> ${GITHUB_ENV} + end=$(date +%s%N) + echo "end=${end}" >> ${GITHUB_ENV} + start=${{ steps.start_time.outputs.start }} + diff=$((end-start)) + duration=sprintf "%s.%s" "${diff:0: -9}" "${diff: -9:3}" + echo "duration=${duration}" >> ${GITHUB_ENV} - name: Notify uses: ./.github/actions/notify @@ -101,7 +108,7 @@ jobs: webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }} title: "[END] Terraform Acceptance Tests" subtitle: "${{ forgejo.event_name }} on branch ${{ forgejo.ref }} with status: ${{ forgejo.event_name == 'workflow_dispatch' && steps.manual_run.outputs.status || steps.automatic_run.outputs.status }}" - event_title: "run ended: ${{ steps.end_time.outputs.time }}" + event_title: "run ended: ${{ steps.end_time.outputs.time }}, duration: ${{ steps.end_time.outputs.duration }} seconds" event_author: ${{ forgejo.actor }} event_body: "${{ forgejo.event_name == 'workflow_dispatch' && steps.manual_run.outputs.result || steps.automatic_run.outputs.result }}" event_number: ${{ forgejo.event.id }}