Files
Euripedes Rocha Filho d7b6a56f13 ci: Remove gcov option to fix coverage report
Override the build config to generate specific job naming for target
jobs
2026-08-26 10:31:18 +02:00

42 lines
1.4 KiB
YAML

host_tests:
image: espressif/idf:release-v6.0
stage: test
tags: [build]
timeout: 1h
variables:
GIT_DEPTH: 1
needs: []
coverage: '/^lines:\s+(\d+\.\d+)\%/'
artifacts:
paths:
- "**/build*/build.log"
- "**/coverage.xml"
- "**/coverage.html"
expire_in: 1 week
when: always
reports:
junit: "**/junit.xml"
coverage_report:
coverage_format: cobertura
path: "**/coverage.xml"
before_script:
- pip install -U gcovr 'idf-ci>=1,<2'
script: |
set -euo pipefail
ORIG_DIR="${CI_PROJECT_DIR:-$(pwd)}"
cd "${ORIG_DIR}"
echo "Original dir: $(pwd)"
rm -rf mqtt
git worktree add --force mqtt HEAD || (echo "Worktree failed; using local clone" && git clone --local --no-hardlinks . mqtt)
git worktree list || true
cd mqtt
idf-ci build run -t linux -p test
cd test/host
./build_linux_coverage/host_mqtt_client_test.elf -r junit -o junit.xml
cd ../mqtt_utils_host_test
./build_linux_default/mqtt_utils_host_test.elf
cd ../mqtt_outbox_host_test
./build_linux_coverage/mqtt_outbox_host_test.elf
cd ../..
gcovr --gcov-ignore-parse-errors -k -r . --exclude '.*/managed_components/.*' --print-summary --html coverage.html -x coverage.xml