Skip to content

Commit bdb29dc

Browse files
committed
cicd like euthri faces
1 parent ea411a2 commit bdb29dc

2 files changed

Lines changed: 111 additions & 89 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 107 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ on:
99
- jazzy-devel
1010
workflow_dispatch:
1111

12-
permissions:
13-
contents: write
14-
checks: write
15-
pull-requests: write
16-
1712
jobs:
1813
build:
1914
runs-on: ubuntu-latest
@@ -112,7 +107,7 @@ jobs:
112107
113108
cd /workspace
114109
115-
# Source the pre-built workspace dependencies from image (hri_msgs, audio_common_msgs)
110+
# Source the pre-built workspace dependencies from image (hri_msgs, etc.)
116111
if [ -f /opt/workspace/install/setup.bash ]; then
117112
source /opt/workspace/install/setup.bash
118113
echo '✅ Sourced pre-built dependencies from image'
@@ -122,10 +117,10 @@ jobs:
122117
colcon list --names-only
123118
124119
# Build Python packages
125-
echo '🔨 Building Python packages: \${{ env.PY_PACKAGES }}'
120+
echo '🔨 Building Python packages: ${{ env.PY_PACKAGES }}'
126121
127122
colcon build --symlink-install \
128-
--packages-select \${{ env.PY_PACKAGES }} \
123+
--packages-select ${{ env.PY_PACKAGES }} \
129124
--parallel-workers 1 \
130125
--event-handlers console_direct+ || echo 'Warning: Some Python packages failed to build'
131126
@@ -142,7 +137,7 @@ jobs:
142137
143138
# Run tests for Python packages (one at a time to reduce memory)
144139
echo '🧪 Running tests...'
145-
PY_PACKAGES_LIST='\${{ env.PY_PACKAGES }}'
140+
PY_PACKAGES_LIST='${{ env.PY_PACKAGES }}'
146141
147142
# List workspace structure to debug
148143
echo \"📁 Workspace structure:\"
@@ -196,16 +191,17 @@ jobs:
196191
fi
197192
"
198193
194+
199195
# Generate human-readable test summary
200196
- name: Generate test summary
201197
if: always()
202198
run: |
203199
source Docker/.env
204200
docker run --rm \
205-
-v ${{ github.workspace }}:/ci_workspace \
206-
-w /ci_workspace \
201+
-v ${{ github.workspace }}:/workspace \
207202
${BUILT_IMAGE} \
208203
bash -c "
204+
cd /workspace
209205
if [ -f /opt/vulcanexus/jazzy/setup.bash ]; then
210206
source /opt/vulcanexus/jazzy/setup.bash
211207
elif [ -f /opt/ros/jazzy/setup.bash ]; then
@@ -233,9 +229,10 @@ jobs:
233229
reporter: java-junit
234230
fail-on-error: false
235231

236-
# Upload test results
232+
# Upload test result
237233
- name: Upload test results
238234
if: always()
235+
continue-on-error: true
239236
uses: actions/upload-artifact@v4
240237
with:
241238
name: test-results
@@ -244,8 +241,27 @@ jobs:
244241
build/*/pytest.xml
245242
log/latest_test/**/*.log
246243
test_summary.txt
244+
if-no-files-found: warn
247245

248-
246+
# Verify coverage files were generated
247+
- name: Verify coverage files
248+
if: always()
249+
run: |
250+
echo "📋 Coverage files generated:"
251+
echo ""
252+
find build -type f \( -name "coverage.*" -o -name ".coverage" \) 2>/dev/null | while read f; do
253+
echo "✅ $f ($(du -h "$f" | cut -f1))"
254+
done
255+
echo ""
256+
echo "📋 Test result files:"
257+
find build -name "pytest.xml" -type f 2>/dev/null | while read f; do
258+
echo "✅ $f"
259+
done
260+
echo ""
261+
echo "📋 HTML coverage files:"
262+
find build -type d -name "htmlcov" 2>/dev/null | while read d; do
263+
echo "✅ $d/ ($(find "$d" -type f | wc -l) files)"
264+
done
249265
# Create test badge (for README)
250266
- name: Create test badge
251267
if: always() && github.ref == 'refs/heads/jazzy-devel'
@@ -283,100 +299,104 @@ jobs:
283299
284300
- name: Upload badge data
285301
if: always() && github.ref == 'refs/heads/jazzy-devel'
302+
continue-on-error: true
286303
uses: actions/upload-artifact@v4
287304
with:
288305
name: test-badge
289306
path: test-badge.json
307+
if-no-files-found: warn
290308

291309

292-
293310
# Generate code coverage reports (from existing test data)
294311
- name: Generate coverage reports
295312
if: always()
296313
run: |
297314
source Docker/.env
298-
docker run --rm \
299-
-v ${{ github.workspace }}:/ci_workspace \
300-
-w /ci_workspace \
301-
${BUILT_IMAGE} \
302-
bash -c "
303-
# Source ROS environment
304-
if [ -f /opt/vulcanexus/jazzy/setup.bash ]; then
305-
source /opt/vulcanexus/jazzy/setup.bash
306-
elif [ -f /opt/ros/jazzy/setup.bash ]; then
307-
source /opt/ros/jazzy/setup.bash
308-
fi
309-
310-
source install/setup.bash 2>/dev/null || true
311-
312-
echo '=========================================='
313-
echo ' Code Coverage Summary Display'
314-
echo '=========================================='
315-
echo ''
316-
317-
# Display Python coverage from existing lcov files
318-
for pkg in ${{ env.PY_PACKAGES }}; do
319-
echo \"📊 Python Coverage (\$pkg)\"
320-
echo '------------------------------------------'
321-
if [ -f \"build/\$pkg/coverage.lcov\" ]; then
322-
# Display coverage summary from lcov file
323-
grep -A 5 'end_of_record' \"build/\$pkg/coverage.lcov\" | head -20 || \
324-
echo \"Coverage data available in build/\$pkg/coverage.lcov\"
325-
else
326-
echo '⚠️ No coverage data found for this package'
327-
fi
328-
echo ''
329-
done
330-
331-
echo '=========================================='
332-
echo '✅ Coverage Reports Displayed!'
333-
echo '=========================================='
334-
" > coverage_summary.txt || true
335315
336-
# Display in logs
337-
cat coverage_summary.txt
316+
echo '=========================================='
317+
echo ' Code Coverage Summary Display'
318+
echo '=========================================='
319+
echo ''
338320
339-
# Add to GitHub Actions summary
340-
echo "" >> $GITHUB_STEP_SUMMARY
341-
echo "## 📊 Code Coverage Summary" >> $GITHUB_STEP_SUMMARY
342-
echo '```' >> $GITHUB_STEP_SUMMARY
343-
cat coverage_summary.txt >> $GITHUB_STEP_SUMMARY
344-
echo '```' >> $GITHUB_STEP_SUMMARY
321+
# Display Python coverage from existing files
322+
for pkg in ${{ env.PY_PACKAGES }}; do
323+
echo "📊 Python Coverage (${pkg})"
324+
echo '------------------------------------------'
325+
326+
# Check for lcov file
327+
if [ -f "build/${pkg}/coverage.lcov" ]; then
328+
echo "✅ Coverage data found in build/${pkg}/coverage.lcov"
329+
# Extract summary from lcov
330+
grep "^LH:\|^LF:" "build/${pkg}/coverage.lcov" | head -5 || true
331+
elif [ -f "build/${pkg}/coverage.xml" ]; then
332+
echo "✅ Coverage data found in build/${pkg}/coverage.xml"
333+
else
334+
echo "⚠️ No coverage data found for this package"
335+
fi
336+
echo ''
337+
done
338+
339+
echo '=========================================='
340+
echo '✅ Coverage Reports Generated!'
341+
echo '=========================================='
342+
343+
# Summary of files found
344+
echo ""
345+
echo "Coverage files summary:"
346+
find build -name "coverage.*" -type f 2>/dev/null | wc -l
347+
echo "coverage files found"
345348
346349
# Convert lcov to Cobertura XML for better tool compatibility
347-
- name: Verify and convert coverage files
350+
- name: Convert coverage to Cobertura XML
348351
if: always()
352+
continue-on-error: true
349353
run: |
350-
# First, check what coverage files exist
351-
echo "🔍 Looking for coverage files..."
352-
find . -name "coverage*.xml" -o -name "coverage*.lcov" 2>/dev/null || true
354+
python3 -m pip install lcov_cobertura --quiet
353355
356+
echo "📋 Looking for coverage files..."
354357
echo ""
355-
echo "📋 Coverage XML files found:"
356-
ls -lh coverage-*.xml 2>/dev/null || echo "⚠️ No coverage-*.xml files found yet"
357358
358-
# Install lcov_cobertura for coverage conversion
359-
python3 -m pip install lcov_cobertura
359+
# Track if any files were found
360+
FILES_FOUND=0
360361
361-
# Convert Python coverage for all packages
362+
# Convert Python coverage lcov files to XML
362363
for pkg in ${{ env.PY_PACKAGES }}; do
363-
if [ -f "build/${pkg}/coverage.lcov" ]; then
364-
python3 -m lcov_cobertura build/${pkg}/coverage.lcov -o coverage-py-${pkg}.xml
365-
echo "✅ Converted Python coverage for ${pkg} to XML"
364+
LCOV_FILE="build/${pkg}/coverage.lcov"
365+
if [ -f "$LCOV_FILE" ]; then
366+
echo "✅ Converting Python coverage for ${pkg}..."
367+
if python3 -m lcov_cobertura "$LCOV_FILE" -o "coverage-py-${pkg}.xml"; then
368+
echo "✅ Generated: coverage-py-${pkg}.xml"
369+
FILES_FOUND=$((FILES_FOUND + 1))
370+
else
371+
echo "⚠️ Failed to convert LCOV for ${pkg}"
372+
fi
366373
else
367-
echo "⚠️ No Python coverage file found for ${pkg}"
374+
echo "ℹ️ coverage.lcov not found for ${pkg} at $LCOV_FILE"
375+
fi
376+
done
377+
378+
# Also copy any existing coverage.xml files
379+
for pkg in ${{ env.PY_PACKAGES }}; do
380+
if [ -f "build/${pkg}/coverage.xml" ]; then
381+
cp "build/${pkg}/coverage.xml" "coverage-py-${pkg}-direct.xml"
382+
echo "✅ Copied coverage.xml for ${pkg}"
383+
FILES_FOUND=$((FILES_FOUND + 1))
368384
fi
369385
done
370386
371-
# Final check of all coverage files
387+
# List all generated coverage files
372388
echo ""
373-
echo "📋 Final coverage XML files:"
374-
ls -lh coverage-*.xml 2>/dev/null || echo "❌ No coverage XML files generated"
389+
echo "📋 Coverage conversion summary:"
390+
ls -lh coverage-*.xml 2>/dev/null && echo "✅ Coverage XML files generated" || echo "ℹ️ No coverage XML files generated (tests may have been skipped or failed)"
391+
echo ""
392+
echo "📋 All build coverage files:"
393+
find build -name "coverage.*" -type f 2>/dev/null | head -20
375394
376395
# Generate Coverage Report for PR (using Cobertura XML)
377396
- name: Code Coverage Report
378397
uses: irongut/CodeCoverageSummary@v1.3.0
379398
if: always()
399+
continue-on-error: true
380400
with:
381401
filename: 'coverage-*.xml'
382402
badge: true
@@ -392,20 +412,25 @@ jobs:
392412
- name: Add Coverage PR Comment
393413
uses: marocchino/sticky-pull-request-comment@v2
394414
if: github.event_name == 'pull_request'
415+
continue-on-error: true
395416
with:
396417
recreate: true
397418
path: code-coverage-results.md
398419

399420
# Upload coverage reports as artifacts
400421
- name: Upload coverage reports
401422
if: always()
423+
continue-on-error: true
402424
uses: actions/upload-artifact@v4
403425
with:
404426
name: coverage-reports
405427
path: |
406-
*/htmlcov/**
428+
build/*/htmlcov
429+
build/*/coverage.lcov
430+
build/*/coverage.xml
407431
coverage_summary.txt
408432
coverage-*.xml
433+
if-no-files-found: warn
409434

410435
# Create coverage badge (for README)
411436
- name: Create coverage badge
@@ -478,11 +503,8 @@ jobs:
478503
if: always() && github.ref == 'refs/heads/jazzy-devel'
479504
run: |
480505
# Determine branch name for badge directory
481-
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
482-
BRANCH_NAME="main"
483-
else
484-
BRANCH_NAME="jazzy-devel"
485-
fi
506+
# Always use 'jazzy-devel' since workflow only runs on jazzy-devel branch
507+
BRANCH_NAME="jazzy-devel"
486508
487509
# Setup git
488510
git config --global user.name "github-actions[bot]"
@@ -541,21 +563,20 @@ jobs:
541563
password: ${{ secrets.DOCKERHUB_TOKEN }}
542564

543565
- name: Tag image for Docker Hub
544-
if: github.ref == 'refs/heads/main'
566+
if: github.ref == 'refs/heads/jazzy-devel'
545567
run: |
546568
# Get the image name from .env file
547569
source Docker/.env
548570
DOCKERHUB_ORG=${{ secrets.DOCKERHUB_ORG }}
549571
550572
# Tag the local image with Docker Hub organization name
551-
docker tag ${BUILT_IMAGE} ${DOCKERHUB_ORG}/eutrobai:${TARGET_DISTRO}
573+
docker tag ${BUILT_IMAGE} ${DOCKERHUB_ORG}/eut_audio_processing:${TARGET_DISTRO}
552574
553575
- name: Push to Docker Hub
554-
if: github.ref == 'refs/heads/main' # IGNORE for now the push, replace it with main branch or jazzy when ready to publish from protected branch
555-
# if: github.ref == 'none' # IGNORE for now the push, replace it with main branch or jazzy when ready to publish from protected branch
576+
if: github.ref == 'none' # IGNORE for now the push, replace it with jazzy-devel when ready to publish from protected branch
556577
run: |
557578
source Docker/.env
558579
DOCKERHUB_ORG=${{ secrets.DOCKERHUB_ORG }}
559580
560581
# Push the image to Docker Hub
561-
docker push ${DOCKERHUB_ORG}/eutrobai:${TARGET_DISTRO}
582+
docker push ${DOCKERHUB_ORG}/eut_audio_processing:${TARGET_DISTRO}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# EutSpeechAudioProcessing: Audio Stream Management, VAD, Speaker Diarization, Wake Word Detection & Speech Recognition
22

3-
[![Build Status](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml/badge.svg?branch=jazzy-devel)](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml?query=branch%3Ajazzy-devel)
4-
[![Tests](https://img.shields.io/badge/tests-0%2F0%20passed-brightgreen)](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml)
5-
[![Coverage](https://img.shields.io/badge/coverage-pending-blue)](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml)
3+
[![Build Status](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml/badge.svg?branch=jazzy-devel)](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml)
4+
5+
[![Tests](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Eurecat/eut_speech_audio_processing/badges/jazzy-devel/test-badge.json)](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml)
6+
[![Coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Eurecat/eut_speech_audio_processing/badges/jazzy-devel/coverage-badge.json)](https://github.com/Eurecat/eut_speech_audio_processing/actions/workflows/ci-cd.yml)
67

78
🚀 Production-ready ROS2 (Jazzy, Humble-WIP) audio perception stack with **advanced VAD and speaker diarization** 🗣️ and **state-of-the-art Whisper ASR** 📝. Uniquely integrates **MongoDB** 💾 for persistent speaker embedding storage with automatic re-identification across sessions—speaker identities survive Docker restarts! Fully containerized architecture with hardware-isolated audio management and modular speech processing pipeline for enterprise-grade human-robot interaction.
89

0 commit comments

Comments
 (0)