From 78a2892dbd6c742049e5f2bfab273d5d6d7765c8 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Thu, 14 Dec 2023 13:50:55 -0500 Subject: [PATCH] Slight format tweak for the ci.yml file to have newlines between jobs. Mark the code blocks as shell in the README.md. Also mark that the GNU complexity score for this repo is capped at 10 now. --- .github/workflows/ci.yml | 15 +++++++++++++++ README.md | 10 +++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a28d886..b1105ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,12 +5,14 @@ on: pull_request: branches: [main] workflow_dispatch: + jobs: build-check: runs-on: ubuntu-latest steps: - name: Clone This Repo uses: actions/checkout@v3 + - name: Build Library in Debug mode run: | cmake -S test -B build/ \ @@ -18,6 +20,7 @@ jobs: -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_FLAGS='-O0 -Wall -Wextra -Werror -Wformat -Wformat-security -Warray-bounds' make -C build/ coverity_analysis -j8 + - name: Build Library in Release mode run: | rm -rf ./build @@ -25,15 +28,18 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DNDEBUG -Wformat -Wformat-security -Warray-bounds' make -C build/ coverity_analysis -j8 + build-code-example: runs-on: ubuntu-latest steps: - name: Clone This Repo uses: actions/checkout@v3 + - name: Build Code Example used in Doxygen run: | cmake -S test -B Build -DBUILD_CODE_EXAMPLE=ON make -C Build code_example_posix -j8 + unittest-with-sanitizer: runs-on: ubuntu-latest steps: @@ -58,16 +64,19 @@ jobs: -DBUILD_UNIT_TESTS=ON \ -DCMAKE_C_FLAGS="${CFLAGS}" make -C build all -j8 + - name: Run unit tests with sanitizer run: | cd build ctest -E system --output-on-failure cd .. + unittest-for-coverage: runs-on: ubuntu-latest steps: - name: Clone This Repo uses: actions/checkout@v3 + - name: Build run: | sudo apt-get install -y lcov sed @@ -78,21 +87,25 @@ jobs: -DBUILD_UNIT_TESTS=ON \ -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -Wno-error=pedantic -Wno-variadic-macros -DLOGGING_LEVEL_DEBUG=1' make -C build/ all + - name: Test run: | cd build/ ctest -E system --output-on-failure cd .. + - name: Run Coverage run: | make -C build/ coverage declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*") echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info lcov --rc lcov_branch_coverage=1 --list build/coverage.info + - name: Check Coverage uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main with: coverage-file: ./build/coverage.info + complexity: runs-on: ubuntu-latest steps: @@ -170,6 +183,7 @@ jobs: uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main with: path: ./ + memory_statistics: runs-on: ubuntu-latest steps: @@ -183,6 +197,7 @@ jobs: with: config: .github/memory_statistics_config.json check_against: docs/doxygen/include/size_table.md + proof_ci: if: ${{ github.event.pull_request }} runs-on: cbmc_ubuntu-latest_16-core diff --git a/README.md b/README.md index 12dc9b9..f44e545 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ servers. This library has gone through code quality checks including verification that no function has a [GNU Complexity](https://www.gnu.org/software/complexity/manual/complexity.html) -score over 8, and checks against deviations from mandatory rules in the +score over 10, and checks against deviations from mandatory rules in the [MISRA coding standard](https://www.misra.org.uk). Deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](MISRA.md). This library has also undergone both static code analysis from @@ -47,20 +47,20 @@ in dependent components. To clone using HTTPS: -``` +```sh git clone https://github.com/FreeRTOS/coreSNTP.git --recurse-submodules ``` Using SSH: -``` +```sh git clone git@github.com:FreeRTOS/coreSNTP.git --recurse-submodules ``` If you have downloaded the repo without using the `--recurse-submodules` argument, you need to run: -``` +```sh git submodule update --init --recursive ``` @@ -135,7 +135,7 @@ The Doxygen references were created using Doxygen version 1.9.2. To generate the Doxygen pages, please run the following command from the root of this repository: -```shell +```sh doxygen docs/doxygen/config.doxyfile ```