Skip to content

Commit ccef7e5

Browse files
authored
Merge pull request #12 from Evagan2018/main
Compare generated DataOutput.xx.sds files with reference DataOutput.xx.ref.sds files
2 parents 72f9d9a + 556ba06 commit ccef7e5

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/AlgorithmTest_ST_B-U585I-IOT02A.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,30 @@ jobs:
5050
run: |
5151
mkdir -p .python_deps
5252
python -m pip install --target .python_deps pyyaml
53+
5354
- name: Cache downloaded packs
5455
uses: actions/cache@v4
5556
with:
5657
key: SDS
5758
path: /home/runner/.cache/arm/packs/.Download
5859

60+
- name: Rename DataOutput.N.sds -> DataOutput.N.ref.sds
61+
working-directory: ./ST/B-U585I-IOT02A/algorithm/SDS Recordings
62+
run: |
63+
64+
for file in DataOutput.*.sds; do
65+
66+
# Skip if no matching files
67+
[ -e "$file" ] || continue
68+
69+
# Insert ".ref" before .sds
70+
newname="${file%.sds}.ref.sds"
71+
72+
echo "Renaming: $file -> $newname"
73+
# Use git mv so the rename is tracked; fall back to mv if file is untracked
74+
git mv --force -- "$file" "$newname" 2>/dev/null || mv -- "$file" "$newname"
75+
done
76+
5977
- name: Build AlgorithmTest for ST B-U585I-IOT2A
6078
working-directory: ./ST/B-U585I-IOT02A
6179
run: |
@@ -68,3 +86,41 @@ jobs:
6886
run: |
6987
cp ../../.ci/sdsio.yml . # configure test case execution
7088
FVP_Corstone_SSE-300 -f Board/Corstone-300/fvp_config.txt -a out/AlgorithmTest/AVH-SSE-300/DebugPlay/AlgorithmTest.axf
89+
90+
- name: Compare SDS output files
91+
working-directory: ./ST/B-U585I-IOT02A/algorithm/SDS Recordings
92+
run: |
93+
94+
mkdir -p ../diff_artifacts # Create folder outside the recordings directory
95+
96+
# Find all *.ref.sds files
97+
for file_ref in DataOutput.*.ref.sds; do
98+
# Strip ".ref" to get the corresponding original file
99+
file_orig="${file_ref/.ref/}"
100+
101+
echo "Comparing $file_ref with $file_orig ..."
102+
103+
if cmp -s "$file_ref" "$file_orig"; then
104+
echo " ✅ Files are identical"
105+
else
106+
echo " ❌ Files differ"
107+
# Copy both versions into the diff_artifacts folder
108+
cp "$file_ref" "$file_orig" ../diff_artifacts/
109+
fi
110+
done
111+
112+
- name: Upload differing SDS files
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: sds-diff-files
116+
path: ST/B-U585I-IOT02A/algorithm/diff_artifacts
117+
118+
- name: Fail if diffs found
119+
working-directory: ./ST/B-U585I-IOT02A/algorithm
120+
run: |
121+
if [ -n "$(ls -A diff_artifacts)" ]; then
122+
echo "❌ Differences found in SDS files!"
123+
exit 1
124+
else
125+
echo "✅ No differences found."
126+
fi

0 commit comments

Comments
 (0)