From 892520699f6615aa3207a2cbec63b941194f9797 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Wed, 25 Oct 2023 13:39:57 +0530 Subject: [PATCH 1/6] coverity scan job --- .github/workflows/coverity_scan.yml | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/coverity_scan.yml diff --git a/.github/workflows/coverity_scan.yml b/.github/workflows/coverity_scan.yml new file mode 100644 index 0000000000..262d3b3c8a --- /dev/null +++ b/.github/workflows/coverity_scan.yml @@ -0,0 +1,47 @@ +name: FreeRTOS-Kernel Coverity Scan +on: + schedule: ## Scheduled to run at 12 AM UTC. + - cron: '0 0 * * *' + + +jobs: + + Coverity-Scan: + name: Coverity Scan + runs-on: ubuntu-latest + steps: + - name: Checkout the Repository + uses: actions/checkout@v3 + + - name: Install Build Essentials + shell: bash + run: | + sudo apt-get -y update + sudo apt-get -y install build-essential + + - name: Install Coverity Build + shell: bash + env: + COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + run: | + wget -nv -qO- https://scan.coverity.com/download/linux64 --post-data "token=${COVERITY_TOKEN}&project=FreeRTOS-Kernel" | tar -zx --one-top-level=cov_scan --strip-components 1 + echo "cov_scan_path=$(pwd)/cov_scan/bin" >> $GITHUB_ENV + + - name: Coverity Build & Upload for Scan + shell: bash + env: + COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + run: | + export PATH="$PATH:${{env.cov_scan_path}}" + mkdir build + cd build + cmake ../examples/cmake_example/ + cov-build --dir cov-int make -j + tar czvf gcc_freertos_kerenl_sample_build.tgz cov-int + COV_SCAN_UPLOAD_STATUS=$(curl --form token=${COVERITY_TOKEN} \ + --form email=tonyjosi@amazon.com \ + --form file=@gcc_freertos_kerenl_sample_build.tgz \ + --form version="Mainline" \ + --form description="GCC Posix Demo" \ + https://scan.coverity.com/builds?project=FreeRTOS-Kernel) + echo "${COV_SCAN_UPLOAD_STATUS}" | grep -q -e 'Build successfully submitted' || echo >&2 "Error submitting build for analysis: ${COV_SCAN_UPLOAD_STATUS}" From 5fef377d768b8ac7605deb199e173e6e4a37834b Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Wed, 25 Oct 2023 13:40:36 +0530 Subject: [PATCH 2/6] coverity scan badge in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c6633563f1..eab5c0099e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![CMock Unit Tests](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml/badge.svg?branch=main&event=push)](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml?query=branch%3Amain+event%3Apush+workflow%3A%22CMock+Unit+Tests%22++) [![codecov](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/badge.svg?branch=main)](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel) +[![Coverity Scan Status](https://scan.coverity.com/projects/freertos-kernel/badge.svg)](https://scan.coverity.com/projects/freertos-kernel) ## Getting started From fba344badd85380c3e741d4a84fa9a2c2783db1d Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Wed, 25 Oct 2023 14:17:48 +0530 Subject: [PATCH 3/6] Update cron schedule --- .github/workflows/coverity_scan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverity_scan.yml b/.github/workflows/coverity_scan.yml index 262d3b3c8a..8bbe88c3e5 100644 --- a/.github/workflows/coverity_scan.yml +++ b/.github/workflows/coverity_scan.yml @@ -1,7 +1,7 @@ name: FreeRTOS-Kernel Coverity Scan on: - schedule: ## Scheduled to run at 12 AM UTC. - - cron: '0 0 * * *' + schedule: ## Scheduled to run at 1:15 AM UTC daily. + - cron: '15 1 * * *' jobs: From 8cce529e4d745df48a587df8bbd08ec436a27774 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Wed, 25 Oct 2023 14:23:46 +0530 Subject: [PATCH 4/6] revert adding badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index eab5c0099e..c6633563f1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![CMock Unit Tests](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml/badge.svg?branch=main&event=push)](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml?query=branch%3Amain+event%3Apush+workflow%3A%22CMock+Unit+Tests%22++) [![codecov](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/badge.svg?branch=main)](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel) -[![Coverity Scan Status](https://scan.coverity.com/projects/freertos-kernel/badge.svg)](https://scan.coverity.com/projects/freertos-kernel) ## Getting started From 1da118803d60cad11aa182a51f31578526aa6698 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Wed, 25 Oct 2023 14:38:18 +0530 Subject: [PATCH 5/6] update description --- .github/workflows/coverity_scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverity_scan.yml b/.github/workflows/coverity_scan.yml index 8bbe88c3e5..23873763c4 100644 --- a/.github/workflows/coverity_scan.yml +++ b/.github/workflows/coverity_scan.yml @@ -42,6 +42,6 @@ jobs: --form email=tonyjosi@amazon.com \ --form file=@gcc_freertos_kerenl_sample_build.tgz \ --form version="Mainline" \ - --form description="GCC Posix Demo" \ + --form description="FreeRTOS Kernel Nightly Scan" \ https://scan.coverity.com/builds?project=FreeRTOS-Kernel) echo "${COV_SCAN_UPLOAD_STATUS}" | grep -q -e 'Build successfully submitted' || echo >&2 "Error submitting build for analysis: ${COV_SCAN_UPLOAD_STATUS}" From 1ff8e6c0ad7ccd478eb8faf1a8bd6f5554e9c46c Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Thu, 26 Oct 2023 09:49:40 +0530 Subject: [PATCH 6/6] updating review feedback --- .github/workflows/coverity_scan.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/coverity_scan.yml b/.github/workflows/coverity_scan.yml index 23873763c4..6f492d7fd0 100644 --- a/.github/workflows/coverity_scan.yml +++ b/.github/workflows/coverity_scan.yml @@ -33,9 +33,8 @@ jobs: COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} run: | export PATH="$PATH:${{env.cov_scan_path}}" - mkdir build + cmake -S ./examples/cmake_example/ -B build cd build - cmake ../examples/cmake_example/ cov-build --dir cov-int make -j tar czvf gcc_freertos_kerenl_sample_build.tgz cov-int COV_SCAN_UPLOAD_STATUS=$(curl --form token=${COVERITY_TOKEN} \