Skip to content

Algorithm Test ST B-U585I-IOT02A (Motion Recognition) #3

Algorithm Test ST B-U585I-IOT02A (Motion Recognition)

Algorithm Test ST B-U585I-IOT02A (Motion Recognition) #3

# SPDX-FileCopyrightText: Copyright 2022-2025 Arm Limited and/or its
# affiliates <[email protected]>
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Algorithm Test ST B-U585I-IOT02A (Motion Recognition)
on:
workflow_dispatch:
#pull_request:
# branches: [main]
#push:
# branches: [main]
#schedule:
# - cron: '00 20 * * 6'
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Activate vcpkg
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: ".ci/vcpkg-configuration-AC6.json"
- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@v1
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install PyYAML in .python_deps
run: |
mkdir -p .python_deps
python -m pip install --target .python_deps pyyaml
- name: Cache downloaded packs
uses: actions/cache@v4
with:
key: SDS
path: /home/runner/.cache/arm/packs/.Download
- name: Rename DataOutput.N.sds -> DataOutput.N.ref.sds
working-directory: ./ST/B-U585I-IOT02A/MotionRecognition/algorithm/SDS Recordings
run: |
for file in DataOutput.*.sds; do
# Skip if no matching files
[ -e "$file" ] || continue
# Insert ".ref" before .sds
newname="${file%.sds}.ref.sds"
echo "Renaming: $file -> $newname"
# Use git mv so the rename is tracked; fall back to mv if file is untracked
git mv --force -- "$file" "$newname" 2>/dev/null || mv -- "$file" "$newname"
done
- name: Build AlgorithmTest for ST B-U585I-IOT2A
working-directory: ./ST/B-U585I-IOT02A/MotionRecognition
run: |
cbuild SDS.csolution.yml --context AlgorithmTest.DebugPlay+AVH-SSE-300 --packs
- name: Execute Test cases
working-directory: ./ST/B-U585I-IOT02A/MotionRecognition
env:
PYTHONPATH: ${{ github.workspace }}/.python_deps
run: |
cp ../../../.ci/sdsio.yml . # configure test case execution
FVP_Corstone_SSE-300 -f Board/Corstone-300/fvp_config.txt -a out/AlgorithmTest/AVH-SSE-300/DebugPlay/AlgorithmTest.axf
- name: Compare SDS output files
working-directory: ./ST/B-U585I-IOT02A/MotionRecognition/algorithm/SDS Recordings
run: |
mkdir -p ../diff_artifacts # Create folder outside the recordings directory
# Find all *.ref.sds files
for file_ref in DataOutput.*.ref.sds; do
# Strip ".ref" to get the corresponding original file
file_orig="${file_ref/.ref/}"
echo "Comparing $file_ref with $file_orig ..."
if cmp -s "$file_ref" "$file_orig"; then
echo " ✅ Files are identical"
else
echo " ❌ Files differ"
# Copy both versions into the diff_artifacts folder
cp "$file_ref" "$file_orig" ../diff_artifacts/
fi
done
- name: Upload differing SDS files
uses: actions/upload-artifact@v4
with:
name: sds-diff-files
path: ST/B-U585I-IOT02A/MotionRecognition/algorithm/diff_artifacts
- name: Fail if diffs found
working-directory: ./ST/B-U585I-IOT02A/MotionRecognition/algorithm
run: |
if [ -n "$(ls -A diff_artifacts)" ]; then
echo "❌ Differences found in SDS files!"
exit 1
else
echo "✅ No differences found."
fi