Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 44 additions & 26 deletions .github/workflows/test-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- main
paths:
- 'main/**'
- 'components/**'
- 'test/**'
- 'CMakeLists.txt'
- 'sdkconfig'
workflow_dispatch:
Expand All @@ -25,14 +27,6 @@ jobs:
command: |
idf.py build

- name: Install QEMU items
uses: espressif/esp-idf-ci-action@v1.2.0
with:
esp_idf_version: 'release-v5.4'
command: |
. $IDF_PATH/export.sh
python $IDF_PATH/tools/idf_tools.py install qemu-xtensa

- name: Validate build artifacts
run: |
if [ ! -f build/remotehead.bin ]; then
Expand All @@ -49,6 +43,37 @@ jobs:
echo "⚠️ Warning: Firmware size is over 1MB"
fi

unit-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install QEMU
run: |
echo "Installing QEMU..."
sudo apt-get update
sudo apt-get install -y qemu-system-arm qemu-user
echo "✅ QEMU installation completed"

- name: Run Tests in QEMU
uses: espressif/esp-idf-ci-action@v1.2.0
with:
esp_idf_version: 'release-v5.4'
command: |
cd test
idf.py build
PYTHONUNBUFFERED=1 timeout 30s idf.py qemu
echo "✅ Tests executed in QEMU"

code-quality:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run basic code quality checks
run: |
echo "🔍 Checking for basic code quality issues..."
Expand Down Expand Up @@ -76,22 +101,15 @@ jobs:
exit 1
fi

# Check test files exist
if [ ! -d "test/main" ]; then
echo "❌ Error: Unit test directory not found"
exit 1
fi

if [ ! -f "test/main/test_main.c" ]; then
echo "❌ Error: Main test file not found"
exit 1
fi

echo "✅ Basic code quality checks completed"

- name: Install QEMU
run: |
echo "Installing QEMU..."
sudo apt-get update
sudo apt-get install -y qemu-system-arm qemu-user
echo "✅ QEMU installation completed"

- name: Run Tests in QEMU
uses: espressif/esp-idf-ci-action@v1.2.0
with:
esp_idf_version: 'release-v5.4'
command: |
cd test
idf.py build
idf.py qemu
echo "✅ Tests executed in QEMU"

Loading