Add duration tracking to test results and change hashes.txt separator to tab

Agent-Logs-Url: https://github.com/cmderdev/cmder/sessions/48204621-5da0-4649-9715-ac9df45f1153

Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-12 00:24:53 +00:00
committed by GitHub
parent cb59bb54b0
commit 0983e9b763
2 changed files with 34 additions and 4 deletions

View File

@@ -124,34 +124,64 @@ jobs:
- name: Testing Clink Shell - name: Testing Clink Shell
id: test-clink id: test-clink
shell: pwsh
run: | run: |
$startTime = Get-Date
cmd /c vendor\init.bat /v /d /t cmd /c vendor\init.bat /v /d /t
$duration = [math]::Round(((Get-Date) - $startTime).TotalSeconds, 2)
echo "duration=$duration" >> $env:GITHUB_OUTPUT
- name: Summary - Clink Shell test - name: Summary - Clink Shell test
if: success() if: success()
shell: pwsh shell: pwsh
run: | run: |
"| Clink Shell | ✅ Passed | Cmd shell initialization |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8 $duration = "${{ steps.test-clink.outputs.duration }}"
if ($duration) {
$duration = "$duration s"
} else {
$duration = "N/A"
}
"| Clink Shell | ✅ Passed | $duration |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
- name: Testing PowerShell - name: Testing PowerShell
id: test-powershell id: test-powershell
shell: pwsh
run: | run: |
$startTime = Get-Date
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$env:CMDER_DEBUG='1'; . 'vendor\profile.ps1'" PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$env:CMDER_DEBUG='1'; . 'vendor\profile.ps1'"
$duration = [math]::Round(((Get-Date) - $startTime).TotalSeconds, 2)
echo "duration=$duration" >> $env:GITHUB_OUTPUT
- name: Summary - PowerShell test - name: Summary - PowerShell test
if: success() if: success()
shell: pwsh shell: pwsh
run: | run: |
"| PowerShell | ✅ Passed | Profile script execution |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8 $duration = "${{ steps.test-powershell.outputs.duration }}"
if ($duration) {
$duration = "$duration s"
} else {
$duration = "N/A"
}
"| PowerShell | ✅ Passed | $duration |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
- name: Testing Bash - name: Testing Bash
id: test-bash id: test-bash
shell: pwsh
run: | run: |
$startTime = Get-Date
bash vendor/cmder.sh bash vendor/cmder.sh
$duration = [math]::Round(((Get-Date) - $startTime).TotalSeconds, 2)
echo "duration=$duration" >> $env:GITHUB_OUTPUT
- name: Summary - Bash test - name: Summary - Bash test
if: success() if: success()
shell: pwsh shell: pwsh
run: | run: |
"| Bash | ✅ Passed | Bash environment initialization |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8 $duration = "${{ steps.test-bash.outputs.duration }}"
if ($duration) {
$duration = "$duration s"
} else {
$duration = "N/A"
}
"| Bash | ✅ Passed | $duration |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
- name: Summary - All tests completed - name: Summary - All tests completed
if: success() if: success()

View File

@@ -70,7 +70,7 @@ if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) {
foreach ($t in $targets.GetEnumerator()) { foreach ($t in $targets.GetEnumerator()) {
Create-Archive "$cmderRoot" "$saveTo\$($t.Name)" $t.Value Create-Archive "$cmderRoot" "$saveTo\$($t.Name)" $t.Value
$hash = (Digest-Hash "$saveTo\$($t.Name)") $hash = (Digest-Hash "$saveTo\$($t.Name)")
Add-Content -path "$saveTo\hashes.txt" -value ($t.Name + ' ' + $hash) Add-Content -path "$saveTo\hashes.txt" -value ($t.Name + "`t" + $hash)
} }
Pop-Location Pop-Location