|
| 1 | +# Copyright (c) 2026 Arm Limited (or its affiliates). All rights reserved. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +name: Test ST Keyword Spotting |
| 18 | +on: |
| 19 | + workflow_dispatch: |
| 20 | + pull_request: |
| 21 | + branches: [main] |
| 22 | + paths: |
| 23 | + - ".github/workflows/Test_ST_KeywordSpotting.yml" |
| 24 | + - "ST/B-U585I-IOT02A/KeywordSpotting/**" |
| 25 | + push: |
| 26 | + branches: [main] |
| 27 | + paths: |
| 28 | + - ".github/workflows/Test_ST_KeywordSpotting.yml" |
| 29 | + - "ST/B-U585I-IOT02A/KeywordSpotting/**" |
| 30 | + |
| 31 | +env: |
| 32 | + DIR: ./ST/B-U585I-IOT02A/KeywordSpotting |
| 33 | + |
| 34 | +jobs: |
| 35 | + CI: |
| 36 | + runs-on: ubuntu-24.04 |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout this repository |
| 40 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 41 | + |
| 42 | + - name: Setup Python 3.13 |
| 43 | + uses: actions/setup-python@v6 |
| 44 | + with: |
| 45 | + python-version: '3.13' |
| 46 | + |
| 47 | + - name: Install required Python packages |
| 48 | + run: pip install pyyaml asyncio |
| 49 | + |
| 50 | + - name: Install vcpkg |
| 51 | + uses: ARM-software/cmsis-actions/setup-vcpkg@v1 |
| 52 | + with: |
| 53 | + version: 2026.04.27 |
| 54 | + |
| 55 | + - name: Install required tools |
| 56 | + uses: ARM-software/cmsis-actions/vcpkg@8a50b77681a484568e08f31fb7c2285c4735f682 # v1.3 |
| 57 | + with: |
| 58 | + config: "./vcpkg-configuration.json" |
| 59 | + cache: "Tools" |
| 60 | + |
| 61 | + - name: Activate Arm tool license |
| 62 | + uses: ARM-software/cmsis-actions/armlm@8a50b77681a484568e08f31fb7c2285c4735f682 # v1.3 |
| 63 | + |
| 64 | + - name: Initialize CMSIS pack root folder |
| 65 | + run: | |
| 66 | + cpackget init https://www.keil.com/pack/index.pidx |
| 67 | + cpackget update-index |
| 68 | +
|
| 69 | + - name: Cache CMSIS packs |
| 70 | + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| 71 | + with: |
| 72 | + key: cmsis-packs-${{ hashFiles('**/*.csolution.yml', '**/*.cproject.yml', '**/*.clayer.yml') }} |
| 73 | + restore-keys: | |
| 74 | + cmsis-packs- |
| 75 | + path: /home/runner/.cache/arm/packs |
| 76 | + |
| 77 | + - name: Build AlgorithmTest project for simulator target (SSE-300-U55) |
| 78 | + working-directory: ${{env.DIR}} |
| 79 | + run: | |
| 80 | + cbuild SDS.csolution.yml --context AlgorithmTest.Debug+SSE-300-U55 --packs --update-rte |
| 81 | +
|
| 82 | + - name: Run on simulator |
| 83 | + working-directory: ${{env.DIR}} |
| 84 | + run: | |
| 85 | + FVP_Corstone_SSE-300_Ethos-U55 -f ./Board/Corstone-300/fvp_config.txt -a ./out/AlgorithmTest/SSE-300-U55/Debug/AlgorithmTest.hex --simlimit 120 || true |
| 86 | +
|
| 87 | + - name: Print sdsio.log file |
| 88 | + working-directory: ${{env.DIR}}/algorithm/SDS Recordings |
| 89 | + run: | |
| 90 | + cat "sdsio.log" |
| 91 | +
|
| 92 | + - name: Compare ML_Out.0.sds and ML_Out.0.p.sds file sizes |
| 93 | + working-directory: ${{env.DIR}}/algorithm/SDS Recordings |
| 94 | + run: | |
| 95 | + if [ "$(stat -c%s "ML_Out.0.sds")" -eq "$(stat -c%s "ML_Out.0.p.sds")" ]; then |
| 96 | + echo "::notice title=PASS::ML_Out.0.sds and ML_Out.0.p.sds file sizes are the same." |
| 97 | + else |
| 98 | + echo "::error title=FAIL::ML_Out.0.sds and ML_Out.0.p.sds file sizes are different. See uploaded artifacts for details." |
| 99 | + exit 1 |
| 100 | + fi |
| 101 | +
|
| 102 | + - name: Upload build and run artifacts |
| 103 | + if: always() |
| 104 | + uses: actions/upload-artifact@v7 |
| 105 | + with: |
| 106 | + name: Test_ST_KeywordSpotting |
| 107 | + path: | |
| 108 | + ${{env.DIR}}/out |
| 109 | + ${{env.DIR}}/algorithm/SDS Recordings |
0 commit comments