Skip to content

Commit 8e865cc

Browse files
committed
Sort resoults
1 parent 24cce18 commit 8e865cc

File tree

1 file changed

+24
-29
lines changed

1 file changed

+24
-29
lines changed

.github/workflows/wireless-performance-autotest.yml

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -245,62 +245,57 @@ jobs:
245245
FILENAME=output.md
246246
cat > "$FILENAME" <<- EOT
247247
## Devices Under Tests
248-
249248
This section presents the performance test results, including key metrics and technical details from the test execution.
250-
**Test Date:** [15.3.2025](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})
249+
**Test Date:** [$(date -u '+%Y-%m-%d %H:%M UTC')](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})
251250
EOT
252251
253252
# Step 1: Get all device identifiers
254-
device_ids=$(ls test | grep -oP 'wlx\w+' | sort | uniq)
253+
device_ids=$(ls test | grep -oP 'wlx\w+' | sort -u)
254+
255+
# Step 2: Collect all metadata and sort by class, then name
256+
sorted_devices=$(for device in $device_ids; do
257+
source test/$device.sysinfo
258+
echo "$DEVICE_CLASS|$DEVICE_NAME|$device"
259+
done | sort)
260+
261+
# Step 3: Output by class and device
262+
current_class=""
263+
while IFS='|' read -r class name device; do
264+
if [ "$class" != "$current_class" ]; then
265+
echo "### $class" >> "$FILENAME"
266+
current_class="$class"
267+
fi
255268
256-
# Step 2: Build a list of unique classes
257-
classes=$(for device in $device_ids; do
258269
source test/$device.sysinfo
259-
echo "$DEVICE_CLASS"
260-
done | sort -u)
261-
262-
# Step 3: Group and output by class
263-
for class in $classes; do
264-
echo "### $class" >> "$FILENAME"
265-
for device in $device_ids; do
266-
source test/$device.sysinfo
267-
if [ "$DEVICE_CLASS" = "$class" ]; then
268-
cat >> "$FILENAME" <<- EOT
270+
271+
cat >> "$FILENAME" <<- EOT
272+
269273
#### $DEVICE_NAME
270274
271275
<img src=https://stuff.armbian.com/netbox/media/devicetype-images/$DEVICE_TYPE.png>
272-
273276
<span style="font-size: 0.5rem;">OS: Armbian v${VERSION}, ${KERNEL}</span>
274277
275278
| Chipset | Class | Average forward speed | Average reverse speed |
276279
|:-----|------|-------:|-------:|
277280
|<span style="font-size: 1.5rem;">$DEVICE_TYPE</span> | <span style="font-size: 1.5rem;">$DEVICE_CLASS</span> | <span style="font-size: 1.5rem;">$DEVICE_TX</span> Mbits/sec | <span style="font-size: 1.5rem;">$DEVICE_RX</span> Mbits/sec |
278281
279282
=== "Forward mode (client to server)"
280-
281283
\`\`\`
282-
$(cat test/$device-tx.log | sed 's/^/ /')
284+
$(sed 's/^/ /' test/$device-tx.log)
283285
\`\`\`
284-
285286
=== "Reverse mode (server to client)"
286-
287287
\`\`\`
288-
$(cat test/$device-rx.log | sed 's/^/ /')
288+
$(sed 's/^/ /' test/$device-rx.log)
289289
\`\`\`
290-
291290
=== "Wireless link info"
292-
293291
\`\`\`
294-
$(cat test/$device-info.log | sed 's/^/ /')
292+
$(sed 's/^/ /' test/$device-info.log)
295293
\`\`\`
296-
297294
EOT
298-
fi
299-
done
300-
done
301295
302-
cat "$FILENAME" >> "$GITHUB_STEP_SUMMARY"
296+
done <<< "$sorted_devices"
303297
298+
cat "$FILENAME" >> "$GITHUB_STEP_SUMMARY"
304299
305300
- name: Replace content in markdown document
306301
run: |

0 commit comments

Comments
 (0)