Skip to content

Commit 086ea28

Browse files
Action: test utilities (#308)
1 parent 9818668 commit 086ea28

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Test SDS-Convert
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- .github/workflows/test_sds-convert.yml
8+
- utilities/sds-convert.py
9+
- utilities/requirements.txt
10+
push:
11+
branches: [main]
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- { sample: accelerometer.0.sds, metadata: accelerometer.sds.yml, format: csv, output: accelerometer.0.csv }
26+
- { sample: accelerometer.1.sds, metadata: accelerometer.sds.yml, format: csv, output: accelerometer.1.csv }
27+
- { sample: adc_raw.0.sds, metadata: adc_raw.sds.yml, format: csv, output: adc_raw.0.csv }
28+
- { sample: counter.0.sds, metadata: counter.sds.yml, format: csv, output: counter.0.csv }
29+
- { sample: empty.0.sds, metadata: empty.sds.yml, format: csv, output: empty.0.csv }
30+
# - { sample: gpio.0.sds, metadata: gpio.sds.yml, format: csv, output: gpio.0.csv }
31+
- { sample: gyroscope.0.sds, metadata: gyroscope.sds.yml, format: csv, output: gyroscope.0.csv }
32+
# - { sample: large_block.0.sds, metadata: large_block.sds.yml, format: csv, output: large_block.0.csv }
33+
- { sample: multi_frame.0.sds, metadata: multi_frame.sds.yml, format: csv, output: multi_frame.0.csv }
34+
- { sample: no_metadata.0.sds, metadata: no_metadata.sds.yml, format: csv, output: no_metadata.0.csv }
35+
- { sample: precision.0.sds, metadata: precision.sds.yml, format: csv, output: precision.0.csv }
36+
- { sample: single_record.0.sds, metadata: single_record.sds.yml, format: csv, output: single_record.0.csv }
37+
- { sample: temperature.0.sds, metadata: temperature.sds.yml, format: csv, output: temperature.0.csv }
38+
- { sample: Test_In.0.sds, metadata: Test_In.sds.yml, format: csv, output: Test_In.0.csv }
39+
- { sample: Test_In.1.sds, metadata: Test_In.sds.yml, format: csv, output: Test_In.1.csv }
40+
- { sample: Test_In.2.sds, metadata: Test_In.sds.yml, format: csv, output: Test_In.2.csv }
41+
- { sample: Test_In.3.sds, metadata: Test_In.sds.yml, format: csv, output: Test_In.3.csv }
42+
# - { sample: Test_Out.0.p.sds, metadata: Test_Out.sds.yml, format: csv, output: Test_Out.0.p.csv }
43+
# - { sample: Test_Out.1.sds, metadata: Test_Out.sds.yml, format: csv, output: Test_Out.1.csv }
44+
# - { sample: Test_Out.2.sds, metadata: Test_Out.sds.yml, format: csv, output: Test_Out.2.csv }
45+
# - { sample: Test_Out.3.sds, metadata: Test_Out.sds.yml, format: csv, output: Test_Out.3.csv }
46+
- { sample: mic_16bit.0.sds, metadata: mic_16bit.sds.yml, format: audio_wav, output: mic_16bit.0.wav }
47+
- { sample: mic_stereo.0.sds, metadata: mic_stereo.sds.yml, format: audio_wav, output: mic_stereo.0.wav }
48+
- { sample: camera_nv12.0.sds, metadata: camera_nv12.sds.yml, format: video, output: camera_nv12.0.mp4 }
49+
# - { sample: camera_raw8.0.sds, metadata: camera_raw8.sds.yml, format: video, output: camera_raw8.0.mp4 }
50+
- { sample: camera_rgb565.0.sds, metadata: camera_rgb565.sds.yml, format: video, output: camera_rgb565.0.mp4 }
51+
- { sample: camera_rgb888.0.sds, metadata: camera_rgb888.sds.yml, format: video, output: camera_rgb888.0.mp4 }
52+
53+
steps:
54+
- name: Checkout SDS Framework
55+
uses: actions/checkout@v7
56+
57+
- name: Checkout SDS sample data
58+
uses: actions/checkout@v7
59+
with:
60+
repository: Open-CMSIS-Pack/sds-sample-data
61+
path: sds-sample-data
62+
63+
- name: Set up Python
64+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
65+
with:
66+
python-version: "3.13"
67+
cache: pip
68+
cache-dependency-path: utilities/requirements.txt
69+
70+
- name: Install dependencies
71+
run: python -m pip install -r utilities/requirements.txt
72+
73+
- name: Convert ${{ matrix.sample }} using ${{ matrix.format }}
74+
shell: bash
75+
run: |
76+
set -euo pipefail
77+
python utilities/sds-convert.py "${{ matrix.format }}" \
78+
-i "sds-sample-data/${{ matrix.sample }}" \
79+
-o "${RUNNER_TEMP}/${{ matrix.output }}" \
80+
-y "sds-sample-data/${{ matrix.metadata }}"
81+
test -s "${RUNNER_TEMP}/${{ matrix.output }}"
82+
# cmp "${RUNNER_TEMP}/${{ matrix.output }}" "sds-sample-data/${{ matrix.output }}"

0 commit comments

Comments
 (0)