Skip to content

Commit e4fe047

Browse files
committed
ci: add a workflow to perform an ECLAIR analysis with a reduced set.
Introduce a workflow to run an analysis using the "first_analysis" selection. This workflow can be adapted use other selections. This workflow is based on the PoC from simhein. Link: https://github.com/simhein/zephyr/blob/53bfddca6b47baab137d2c6f0b365e79033dfd97/.github/workflows/eclair_guideline_check.yml Signed-off-by: Luca Ciucci <[email protected]>
1 parent 7b49c1c commit e4fe047

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Eclair Zephyr Guideline Selection Check"
2+
on: push
3+
4+
jobs:
5+
Analyze:
6+
runs-on: self-hosted
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v4
10+
with:
11+
ref: ${{ github.ref }}
12+
path: zephyr
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: 3.11
18+
19+
- name: venv setup
20+
working-directory: zephyr
21+
run: |
22+
python3 -m venv .venv
23+
source .venv/bin/activate
24+
pip install --upgrade pip
25+
26+
- name: west setup
27+
working-directory: zephyr
28+
run: |
29+
source .venv/bin/activate
30+
pip3 install west
31+
git config --global user.email "[email protected]"
32+
git config --global user.name "Your Name"
33+
west init -l . || true
34+
west update
35+
west zephyr-export
36+
west packages pip --install
37+
west sdk install
38+
39+
- name: Build and analyze with ECLAIR
40+
working-directory: zephyr
41+
shell: bash
42+
run: |
43+
source .venv/bin/activate
44+
west build -b nrf52dk/nrf52805 samples/basic/blinky -- \
45+
-DZEPHYR_SCA_VARIANT=eclair -DECLAIR_RULESET_FIRST_ANALYSIS=ON \
46+
-DECLAIR_SUMMARY_HTML=ON \
47+
-DECLAIR_REPORTS_SARIF=ON
48+
49+
- name: Upload ECLAIR artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: artifacts
53+
path: zephyr/build/sca/eclair/
54+
55+
- name: Upload ECLAIR SARIF
56+
uses: BUGSENG/codeql-action/upload-sarif@v2
57+
with:
58+
sarif_file: zephyr/build/sca/eclair/reports.sarif
59+
category: eclair-analysis

0 commit comments

Comments
 (0)