Files
esp-mqtt/.gitlab/ci/test.yml
T
2026-05-27 07:03:33 +02:00

41 lines
1.3 KiB
YAML

host_tests:
image: espressif/idf:release-v6.0
stage: test
tags: [build]
timeout: 1h
variables:
GIT_DEPTH: 1
needs: []
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 -g -k -r . --html coverage.html -x coverage.xml