mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-06-25 17:31:33 +02:00
fix(ci): enable code coverage publishing to github pages
This commit is contained in:
34
.github/workflows/modem__build-host-tests.yml
vendored
34
.github/workflows/modem__build-host-tests.yml
vendored
@ -91,6 +91,8 @@ jobs:
|
|||||||
if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push'
|
if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push'
|
||||||
name: Run gcovr on esp modem host test
|
name: Run gcovr on esp modem host test
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
container: espressif/idf:release-v4.3
|
container: espressif/idf:release-v4.3
|
||||||
env:
|
env:
|
||||||
lwip: lwip-2.1.2
|
lwip: lwip-2.1.2
|
||||||
@ -102,6 +104,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: esp-protocols
|
path: esp-protocols
|
||||||
|
repository: ''
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Build and Test
|
- name: Build and Test
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -128,8 +131,7 @@ jobs:
|
|||||||
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_modem_coverage.xml
|
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_modem_coverage.xml
|
||||||
mkdir docs_gcovr
|
mkdir docs_gcovr
|
||||||
cp $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/index.html docs_gcovr
|
cp $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/index.html docs_gcovr
|
||||||
touch docs_gcovr/.nojekyll
|
cp -rf docs_gcovr $GITHUB_WORKSPACE
|
||||||
|
|
||||||
- name: Code Coverage Summary Report
|
- name: Code Coverage Summary Report
|
||||||
uses: irongut/CodeCoverageSummary@v1.3.0
|
uses: irongut/CodeCoverageSummary@v1.3.0
|
||||||
with:
|
with:
|
||||||
@ -142,7 +144,6 @@ jobs:
|
|||||||
indicators: true
|
indicators: true
|
||||||
output: both
|
output: both
|
||||||
thresholds: '60 80'
|
thresholds: '60 80'
|
||||||
|
|
||||||
- name: Write to Job Summary
|
- name: Write to Job Summary
|
||||||
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
|
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
@ -154,24 +155,9 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
${{ env.COMP_DIR }}/docs_gcovr
|
${{ env.COMP_DIR }}/docs_gcovr
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
- name: Deploy code coverage results
|
||||||
# show_report_data:
|
if: github.ref == 'refs/heads/master'
|
||||||
# name: Publish-Results
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
# if: github.ref == 'refs/heads/master' || github.repository != 'espressif/esp-protocols'
|
with:
|
||||||
# runs-on: ubuntu-22.04
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# needs: gcovr_analyzer_esp_modem
|
publish_dir: ./docs_gcovr
|
||||||
# steps:
|
|
||||||
# - name: Checkout 🛎️
|
|
||||||
# uses: actions/checkout@v3
|
|
||||||
# with:
|
|
||||||
# persist-credentials: false
|
|
||||||
# - name: Download Artifacts
|
|
||||||
# uses: actions/download-artifact@v1
|
|
||||||
# with:
|
|
||||||
# name: docs_gcovr
|
|
||||||
#
|
|
||||||
# - name: Deploy generated docs
|
|
||||||
# uses: JamesIves/github-pages-deploy-action@v4
|
|
||||||
# with:
|
|
||||||
# branch: gh-pages
|
|
||||||
# folder: 'docs_gcovr'
|
|
||||||
|
@ -47,15 +47,3 @@ if(${target} STREQUAL "linux")
|
|||||||
# This is needed for ESP_LOGx() macros, as integer formats differ on ESP32(..) and x64
|
# This is needed for ESP_LOGx() macros, as integer formats differ on ESP32(..) and x64
|
||||||
set_target_properties(${COMPONENT_LIB} PROPERTIES COMPILE_FLAGS -Wno-format)
|
set_target_properties(${COMPONENT_LIB} PROPERTIES COMPILE_FLAGS -Wno-format)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_GCOV_ENABLED)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
|
|
||||||
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
CMAKE_CXX_FLAGS_COVERAGE
|
|
||||||
CMAKE_C_FLAGS_COVERAGE
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
|
|
||||||
endif()
|
|
||||||
|
@ -13,15 +13,3 @@ idf_component_get_property(esp_modem esp_modem COMPONENT_LIB)
|
|||||||
target_compile_definitions(${esp_modem} PRIVATE "-DCONFIG_COMPILER_CXX_EXCEPTIONS")
|
target_compile_definitions(${esp_modem} PRIVATE "-DCONFIG_COMPILER_CXX_EXCEPTIONS")
|
||||||
target_compile_definitions(${esp_modem} PRIVATE "-DCONFIG_IDF_TARGET_LINUX")
|
target_compile_definitions(${esp_modem} PRIVATE "-DCONFIG_IDF_TARGET_LINUX")
|
||||||
target_link_options(${esp_modem} INTERFACE -fsanitize=address -fsanitize=undefined)
|
target_link_options(${esp_modem} INTERFACE -fsanitize=address -fsanitize=undefined)
|
||||||
|
|
||||||
if(CONFIG_GCOV_ENABLED)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
|
|
||||||
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
CMAKE_CXX_FLAGS_COVERAGE
|
|
||||||
CMAKE_C_FLAGS_COVERAGE
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
|
|
||||||
endif()
|
|
||||||
|
@ -12,3 +12,12 @@ set_target_properties(${COMPONENT_LIB} PROPERTIES
|
|||||||
CXX_EXTENSIONS ON
|
CXX_EXTENSIONS ON
|
||||||
)
|
)
|
||||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE "-DCONFIG_IDF_TARGET_LINUX")
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE "-DCONFIG_IDF_TARGET_LINUX")
|
||||||
|
|
||||||
|
if(CONFIG_GCOV_ENABLED)
|
||||||
|
target_compile_options(${COMPONENT_LIB} PUBLIC --coverage -fprofile-arcs -ftest-coverage)
|
||||||
|
target_link_options(${COMPONENT_LIB} PUBLIC --coverage -fprofile-arcs -ftest-coverage)
|
||||||
|
|
||||||
|
idf_component_get_property(esp_modem esp_modem COMPONENT_LIB)
|
||||||
|
target_compile_options(${esp_modem} PUBLIC --coverage -fprofile-arcs -ftest-coverage)
|
||||||
|
target_link_options(${esp_modem} PUBLIC --coverage -fprofile-arcs -ftest-coverage)
|
||||||
|
endif()
|
||||||
|
Reference in New Issue
Block a user