Skip to content

Commit 149613e

Browse files
committed
ci: add coverity scan action
Add an action for scanning using scan.coverity.com. Signed-off-by: Anas Nashif <[email protected]>
1 parent 5601af3 commit 149613e

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/coverity.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Code Scanning
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
- v*-branch
10+
- collab-*
11+
permissions:
12+
contents: read
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
ScanCode:
19+
if: github.repository_owner == 'zephyrproject-rtos'
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set Up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
cache: pip
32+
cache-dependency-path: scripts/requirements-actions.txt
33+
34+
- name: install-packages
35+
run: |
36+
pip install -r scripts/requirements-actions.txt --require-hashes
37+
38+
- name: Setup Zephyr project
39+
uses: nashif/action-zephyr-setup@main
40+
with:
41+
app-path: .
42+
sdk-version: 0.17.0
43+
toolchains: all
44+
west-group-filter: -hal,-tools,-bootloader,-babblesim
45+
west-project-filter: -nrf_hw_models
46+
47+
- name: SCA Setup
48+
uses: zephyrproject-rtos/action-sca-setup@main
49+
with:
50+
tool-name: coverity
51+
install-dir: coverity
52+
s3-access-key-id: ${{ secrets.TOOLDIST_ACCESS_KEY }}
53+
s3-secret-access-key: ${{ secrets.TOOLDIST_SECRET_ACCESS_KEY }}
54+
55+
- name: Check Env
56+
run: |
57+
export COVERITY_OUTPUT_DIR=${PWD}/cov-int
58+
./scripts/twister -p qemu_x86 -T samples/hello_world/ --build-only -v -xZEPHYR_SCA_VARIANT=coverity
59+
60+
tar -cJvf coverity-results.tar.xz cov-int
61+
62+
ver=`git describe`
63+
echo "PAYLOAD_VERSION=${ver}" >> $GITHUB_ENV
64+
echo "PAYLOAD_DESC=${ver}" >> $GITHUB_ENV
65+
66+
- name: Analyze
67+
uses: zephyrproject-rtos/action-sca-setup/analyze@main
68+
with:
69+
tool-name: coverity
70+
payload: coverity-results.tar.xz
71+
service: https://scan.coverity.com/builds?project=Zephyr+Testing
72+
user: ${{ secrets.COVERITY_USER }}
73+
token: ${{ secrets.COVERITY_TOKEN }}
74+
version: ${{ env.PAYLOAD_VERSION }}
75+
description: ${{ env.PAYLOAD_DESC }}

0 commit comments

Comments
 (0)