Skip to content

Commit 0983e9b

Browse files
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>
1 parent cb59bb5 commit 0983e9b

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

.github/workflows/tests.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,34 +124,64 @@ jobs:
124124
125125
- name: Testing Clink Shell
126126
id: test-clink
127+
shell: pwsh
127128
run: |
129+
$startTime = Get-Date
128130
cmd /c vendor\init.bat /v /d /t
131+
$duration = [math]::Round(((Get-Date) - $startTime).TotalSeconds, 2)
132+
echo "duration=$duration" >> $env:GITHUB_OUTPUT
129133
130134
- name: Summary - Clink Shell test
131135
if: success()
132136
shell: pwsh
133137
run: |
134-
"| Clink Shell | ✅ Passed | Cmd shell initialization |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
138+
$duration = "${{ steps.test-clink.outputs.duration }}"
139+
if ($duration) {
140+
$duration = "$duration s"
141+
} else {
142+
$duration = "N/A"
143+
}
144+
"| Clink Shell | ✅ Passed | $duration |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
135145
- name: Testing PowerShell
136146
id: test-powershell
147+
shell: pwsh
137148
run: |
149+
$startTime = Get-Date
138150
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$env:CMDER_DEBUG='1'; . 'vendor\profile.ps1'"
151+
$duration = [math]::Round(((Get-Date) - $startTime).TotalSeconds, 2)
152+
echo "duration=$duration" >> $env:GITHUB_OUTPUT
139153
140154
- name: Summary - PowerShell test
141155
if: success()
142156
shell: pwsh
143157
run: |
144-
"| PowerShell | ✅ Passed | Profile script execution |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
158+
$duration = "${{ steps.test-powershell.outputs.duration }}"
159+
if ($duration) {
160+
$duration = "$duration s"
161+
} else {
162+
$duration = "N/A"
163+
}
164+
"| PowerShell | ✅ Passed | $duration |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
145165
- name: Testing Bash
146166
id: test-bash
167+
shell: pwsh
147168
run: |
169+
$startTime = Get-Date
148170
bash vendor/cmder.sh
171+
$duration = [math]::Round(((Get-Date) - $startTime).TotalSeconds, 2)
172+
echo "duration=$duration" >> $env:GITHUB_OUTPUT
149173
150174
- name: Summary - Bash test
151175
if: success()
152176
shell: pwsh
153177
run: |
154-
"| Bash | ✅ Passed | Bash environment initialization |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
178+
$duration = "${{ steps.test-bash.outputs.duration }}"
179+
if ($duration) {
180+
$duration = "$duration s"
181+
} else {
182+
$duration = "N/A"
183+
}
184+
"| Bash | ✅ Passed | $duration |" | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
155185
156186
- name: Summary - All tests completed
157187
if: success()

scripts/pack.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) {
7070
foreach ($t in $targets.GetEnumerator()) {
7171
Create-Archive "$cmderRoot" "$saveTo\$($t.Name)" $t.Value
7272
$hash = (Digest-Hash "$saveTo\$($t.Name)")
73-
Add-Content -path "$saveTo\hashes.txt" -value ($t.Name + ' ' + $hash)
73+
Add-Content -path "$saveTo\hashes.txt" -value ($t.Name + "`t" + $hash)
7474
}
7575

7676
Pop-Location

0 commit comments

Comments
 (0)