Add validate UCM workflow

pull/4/head
WeirdTreeThing 2023-08-22 22:47:30 -04:00
parent 402b6b6f54
commit 45bab3be32
No known key found for this signature in database
GPG Key ID: 1F56A4B52998B851
2 changed files with 33 additions and 0 deletions

14
.github/workflows/validate-ucm.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: Validate UCM
on:
push:
branches: ["main"]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Validate UCM config
run: bash validate-ucm.sh

19
validate-ucm.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# Script to check each HiFi file for any keywords from the ChromeOS UCM
# that should have been removed
failed=0
filtered_keywords=('cdev' 'FullySpecifiedUCM' 'DspName' 'sof' 'JackDev' 'JackSwitch' 'Line Out' 'CaptureChannelMap' 'IntrinsicSensitivity')
for keyword in "${filtered_keywords[@]}"; do
find -name "HiFi*.conf" -exec grep "${keyword}" {} + && failed=1
done
if [ $failed = 1 ]; then
echo "UCM validation failed"
exit 1
else
echo "UCM validation passed"
exit 0
fi