Skip to content

Commit 1b0ba88

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

File tree

1 file changed

+62
-52
lines changed

1 file changed

+62
-52
lines changed

.github/workflows/codeql.yml

Lines changed: 62 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -57,63 +57,73 @@ 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
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
7993

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
94+
# Add any setup steps before running the `github/codeql-action/init` action.
95+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
96+
# or others). This is typically only required for manual builds.
97+
# - name: Setup runtime (example)
98+
# uses: actions/setup-example@v1
8599

86-
# Add any setup steps before running the `github/codeql-action/init` action.
87-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
88-
# or others). This is typically only required for manual builds.
89-
# - name: Setup runtime (example)
90-
# uses: actions/setup-example@v1
100+
# Initializes the CodeQL tools for scanning.
101+
- name: Initialize CodeQL
102+
uses: github/codeql-action/init@v3
103+
with:
104+
languages: ${{ matrix.language }}
105+
build-mode: ${{ matrix.build-mode }}
106+
source-root: zephyr
107+
# If you wish to specify custom queries, you can do so here or in a config file.
108+
# By default, queries listed here will override any specified in a config file.
109+
# Prefix the list here with "+" to use these queries and those in the config file.
91110

92-
# Initializes the CodeQL tools for scanning.
93-
- name: Initialize CodeQL
94-
uses: github/codeql-action/init@v3
95-
with:
96-
languages: ${{ matrix.language }}
97-
build-mode: ${{ matrix.build-mode }}
98-
# If you wish to specify custom queries, you can do so here or in a config file.
99-
# By default, queries listed here will override any specified in a config file.
100-
# Prefix the list here with "+" to use these queries and those in the config file.
111+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
112+
# queries: security-extended,security-and-quality
101113

102-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
103-
# queries: security-extended,security-and-quality
114+
# If the analyze step fails for one of the languages you are analyzing with
115+
# "We were unable to automatically build your code", modify the matrix above
116+
# to set the build mode to "manual" for that language. Then modify this step
117+
# to build your code.
118+
# ℹ️ Command-line programs to run using the OS shell.
119+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
120+
- if: matrix.build-mode == 'manual'
121+
shell: bash
122+
run: |
123+
west build -b qemu_x86 samples/hello_world
104124
105-
# If the analyze step fails for one of the languages you are analyzing with
106-
# "We were unable to automatically build your code", modify the matrix above
107-
# to set the build mode to "manual" for that language. Then modify this step
108-
# to build your code.
109-
# ℹ️ Command-line programs to run using the OS shell.
110-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
111-
- if: matrix.build-mode == 'manual'
112-
shell: bash
113-
run: |
114-
west build -b native_sim samples/hello_world
115-
116-
- name: Perform CodeQL Analysis
117-
uses: github/codeql-action/analyze@v3
118-
with:
119-
category: "/language:${{matrix.language}}"
125+
- name: Perform CodeQL Analysis
126+
uses: github/codeql-action/analyze@v3
127+
with:
128+
category: "/language:${{matrix.language}}"
129+
checkout_path: zephyr

0 commit comments

Comments
 (0)