Skip to content

Commit 5281427

Browse files
Add nightly coverity scan (#859)
* coverity scan job * coverity scan badge in readme * Update cron schedule * revert adding badge * update description * updating review feedback
1 parent 4ef0bb6 commit 5281427

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/coverity_scan.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: FreeRTOS-Kernel Coverity Scan
2+
on:
3+
schedule: ## Scheduled to run at 1:15 AM UTC daily.
4+
- cron: '15 1 * * *'
5+
6+
7+
jobs:
8+
9+
Coverity-Scan:
10+
name: Coverity Scan
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout the Repository
14+
uses: actions/checkout@v3
15+
16+
- name: Install Build Essentials
17+
shell: bash
18+
run: |
19+
sudo apt-get -y update
20+
sudo apt-get -y install build-essential
21+
22+
- name: Install Coverity Build
23+
shell: bash
24+
env:
25+
COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
26+
run: |
27+
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
28+
echo "cov_scan_path=$(pwd)/cov_scan/bin" >> $GITHUB_ENV
29+
30+
- name: Coverity Build & Upload for Scan
31+
shell: bash
32+
env:
33+
COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
34+
run: |
35+
export PATH="$PATH:${{env.cov_scan_path}}"
36+
cmake -S ./examples/cmake_example/ -B build
37+
cd build
38+
cov-build --dir cov-int make -j
39+
tar czvf gcc_freertos_kerenl_sample_build.tgz cov-int
40+
COV_SCAN_UPLOAD_STATUS=$(curl --form token=${COVERITY_TOKEN} \
41+
42+
--form file=@gcc_freertos_kerenl_sample_build.tgz \
43+
--form version="Mainline" \
44+
--form description="FreeRTOS Kernel Nightly Scan" \
45+
https://scan.coverity.com/builds?project=FreeRTOS-Kernel)
46+
echo "${COV_SCAN_UPLOAD_STATUS}" | grep -q -e 'Build successfully submitted' || echo >&2 "Error submitting build for analysis: ${COV_SCAN_UPLOAD_STATUS}"

0 commit comments

Comments
 (0)