Increase UT coverage #115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Producer C SDK Codecov | |
on: | |
push: | |
branches: | |
- develop | |
- master | |
pull_request: | |
branches: | |
- develop | |
- master | |
jobs: | |
linux-gcc-code-coverage: | |
runs-on: ubuntu-20.04 | |
env: | |
AWS_KVS_LOG_LEVEL: 2 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Build repository | |
run: | | |
sudo apt install lcov | |
mkdir build && cd build | |
cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE -DBUILD_COMMON_LWS=TRUE | |
make | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
role-duration-seconds: 10800 | |
- name: Run tests | |
run: | | |
cd build | |
ulimit -c unlimited -S | |
source ../scripts/get-iot-certs.sh ci | |
timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure | |
- name: Generate and process coverage data with lcov | |
run: | | |
cd build | |
lcov --capture --directory CMakeFiles/cproducer.dir --directory CMakeFiles/kvsCommonCurl.dir --directory CMakeFiles/kvsCommonLws.dir --output-file coverage.info | |
lcov --list coverage.info | |
lcov --remove coverage.info '*jsmn*' -o coverage_filtered.info | |
lcov --list coverage_filtered.info | |
rm coverage.info | |
bash <(curl -s https://codecov.io/bash) -f ./coverage_filtered.info -t ${{ secrets.CODECOV_TOKEN }} -Z |