Skip to content

Commit

Permalink
Update the PR checks to not specify branch or line coverage numbers. …
Browse files Browse the repository at this point in the history
…Fix some spacing. Some echo group cleanup. Use the same build flag for test builds now that the repos have been updated to use the same flag.
  • Loading branch information
Skptak committed Apr 4, 2024
1 parent 62a6f01 commit 2e2c63f
Showing 1 changed file with 68 additions and 70 deletions.
138 changes: 68 additions & 70 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ jobs:
run-link-verifier: true,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_UNIT_TESTS=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror',
build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*3rdparty\*"',
line-coverage: 100,
},
{
repository: coreHTTP,
Expand All @@ -66,7 +65,6 @@ jobs:
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*3rdparty\*"',
line-coverage: 100,
},
{
repository: coreJSON,
Expand All @@ -77,7 +75,6 @@ jobs:
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*source\*"',
line-coverage: 100,
},
{
repository: coreMQTT,
Expand All @@ -88,7 +85,6 @@ jobs:
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 100,
},
{
repository: corePKCS11,
Expand All @@ -97,9 +93,8 @@ jobs:
run-link-verifier: true,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTS=1 -DSYSTEM_TESTS=0 -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG',
build-flags: -DCMAKE_BUILD_TYPE=Debug -DSYSTEM_TESTS=0 -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 95,
},
{
repository: coreSNTP,
Expand All @@ -108,9 +103,8 @@ jobs:
run-link-verifier: true,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_UNIT_TESTS=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -Wno-error=pedantic -Wno-variadic-macros -DLOGGING_LEVEL_DEBUG=1',
build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -Wno-error=pedantic -Wno-variadic-macros -DLOGGING_LEVEL_DEBUG=1',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 100,
},
{
repository: FreeRTOS-Cellular-Interface,
Expand All @@ -121,7 +115,6 @@ jobs:
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 99,
},
{
repository: Device-Defender-for-AWS-IoT-embedded-sdk,
Expand All @@ -132,61 +125,54 @@ jobs:
run-doxygen: true,
build-flags: -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 100,
},
{
repository: Device-Shadow-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 100,
},
{
repository: Fleet-Provisioning-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 100,
},
{
repository: Jobs-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: false,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*source\*"',
line-coverage: 100,

},
{
repository: ota-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG',
line-coverage: 95,
},
{
repository: SigV4-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_UNIT_TESTS=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG -DLOGGING_LEVEL_DEBUG=1',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
line-coverage: 100,
},
{
repository: Device-Shadow-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
},
{
repository: Fleet-Provisioning-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
},
{
repository: Jobs-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: false,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*source\*"',
},
{
repository: ota-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-link-verifier: true,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG',
},
{
repository: SigV4-for-AWS-IoT-embedded-sdk,
org: AWS,
branch: main,
run-complexity: true,
run-doxygen: true,
build-flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG -DLOGGING_LEVEL_DEBUG=1',
coverage-skips: '"\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*"',
},
]
steps:
- uses: actions/checkout@v4.1.1
Expand Down Expand Up @@ -256,15 +242,21 @@ jobs:
working-directory: repo/${{ matrix.inputs.repository }}_Recursive
run: git submodule update --checkout --init --recursive

- name: Build ${{matrix.inputs.repository}}
- env:
stepName: Build ${{matrix.inputs.repository}}
if: matrix.inputs.run-complexity && ( success() || failure() )
shell: bash
working-directory: repo/${{matrix.inputs.repository}}_Recursive
run: |
echo -e "::group:: Install lcov"
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} Install lcov ${{ env.bashEnd }}"
sudo apt-get update -y
sudo apt-get install -y lcov
echo -e "::endgroup::"
cmake -S ./test -B build/ ${{ matrix.inputs.build-flags }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S ./test -B build/ ${{ matrix.inputs.build-flags }} -DUNITTEST=ON
make -C build/ all
- name: Test
Expand All @@ -289,27 +281,33 @@ jobs:
output: size_table_new.html
check_against: docs/doxygen/include/size_table.md

- name: Run Coverage ${{matrix.inputs.repository}}
- env:
stepName: Run Coverage ${{matrix.inputs.repository}}
if: matrix.inputs.run-complexity && ( success() || failure() )
shell: bash
working-directory: repo/${{matrix.inputs.repository}}_Recursive
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} Build ${{matrix.inputs.repository}} ${{ env.bashEnd }}"
make -C build/ coverage
echo -e "::endgroup::"
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
if [[ "${{ matrix.inputs.coverage-skips }}" != "" ]]; then
declare -a EXCLUDE=( ${{ matrix.inputs.coverage-skips }} )
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
else
lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
fi
echo -e "::endgroup::"
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
- name: Test coverage cop action ${{matrix.inputs.repository}}
if: matrix.inputs.run-complexity && ( success() || failure() )
uses: ./coverage-cop
with:
coverage-file: repo/${{matrix.inputs.repository}}_Recursive/build/coverage.info
branch-coverage-min: 70
line-coverage-min: ${{ matrix.inputs.line-coverage }}

PR-uncrustify-checks:
runs-on: ubuntu-20.04
Expand Down

0 comments on commit 2e2c63f

Please sign in to comment.