Skip to content

Commit cd4dfed

Browse files
committed
clean
Signed-off-by: Anas Nashif <[email protected]>
1 parent 1bc91c5 commit cd4dfed

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

.github/workflows/codeql.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,39 @@ jobs:
5757
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
5858
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
5959
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
60-
steps:
61-
- name: Checkout repository
62-
uses: actions/checkout@v4
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63+
with:
64+
path: zephyr
65+
fetch-depth: 0
6366

64-
- name: Set up Python
65-
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
66-
with:
67-
python-version: 3.11
67+
- name: Rebase
68+
if: github.event_name == 'pull_request'
69+
env:
70+
BASE_REF: ${{ github.base_ref }}
71+
PR_HEAD: ${{ github.event.pull_request.head.sha }}
72+
working-directory: zephyr
73+
shell: bash
74+
run: |
75+
git config --global user.email "[email protected]"
76+
git config --global user.name "Github Actions"
77+
rm -fr ".git/rebase-apply"
78+
rm -fr ".git/rebase-merge"
79+
git rebase origin/${BASE_REF}
80+
git clean -f -d
81+
git log --graph --oneline HEAD...${PR_HEAD}
6882

69-
- name: cache-pip
70-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
71-
with:
72-
path: ~/.cache/pip
73-
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/compliance.yml') }}
83+
- name: Set up Python
84+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
85+
with:
86+
python-version: 3.11
7487

75-
- name: Install python dependencies
76-
run: |
77-
pip install -r scripts/requirements-compliance.txt
78-
pip install west
79-
80-
- name: west setup
81-
run: |
82-
west init -l . || true
83-
west config manifest.group-filter -- +ci,-optional,-hal
84-
west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log
88+
- name: Setup Zephyr project
89+
uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6
90+
with:
91+
app-path: zephyr
92+
toolchains: all
8593

8694
# Add any setup steps before running the `github/codeql-action/init` action.
8795
# This includes steps like installing compilers or runtimes (`actions/setup-node`
@@ -95,6 +103,7 @@ jobs:
95103
with:
96104
languages: ${{ matrix.language }}
97105
build-mode: ${{ matrix.build-mode }}
106+
source-root: zephyr
98107
# If you wish to specify custom queries, you can do so here or in a config file.
99108
# By default, queries listed here will override any specified in a config file.
100109
# Prefix the list here with "+" to use these queries and those in the config file.
@@ -111,9 +120,10 @@ jobs:
111120
- if: matrix.build-mode == 'manual'
112121
shell: bash
113122
run: |
114-
west build -b native_sim samples/hello_world
123+
west build -b qemu_x86 samples/hello_world
115124

116125
- name: Perform CodeQL Analysis
117126
uses: github/codeql-action/analyze@v3
118127
with:
119128
category: "/language:${{matrix.language}}"
129+
checkout_path: zephyr

0 commit comments

Comments
 (0)