Skip to content

Commit 69834c9

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

File tree

1 file changed

+45
-78
lines changed

1 file changed

+45
-78
lines changed

.github/workflows/codeql.yml

Lines changed: 45 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL Advanced"
132

143
on:
@@ -22,11 +11,6 @@ on:
2211
jobs:
2312
analyze:
2413
name: Analyze (${{ matrix.language }})
25-
# Runner size impacts CodeQL analysis time. To learn more, please see:
26-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27-
# - https://gh.io/supported-runners-and-hardware-resources
28-
# - https://gh.io/using-larger-runners (GitHub.com only)
29-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
3014
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
3115
permissions:
3216
# required for all workflows
@@ -49,71 +33,54 @@ jobs:
4933
build-mode: manual
5034
- language: python
5135
build-mode: none
52-
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
53-
# Use `c-cpp` to analyze code written in C, C++ or both
54-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
55-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
56-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
57-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
58-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
59-
# 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
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
with:
40+
path: zephyr
41+
fetch-depth: 0
6342

64-
- name: Set up Python
65-
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
66-
with:
67-
python-version: 3.11
43+
- name: Rebase
44+
if: github.event_name == 'pull_request'
45+
env:
46+
BASE_REF: ${{ github.base_ref }}
47+
PR_HEAD: ${{ github.event.pull_request.head.sha }}
48+
working-directory: zephyr
49+
shell: bash
50+
run: |
51+
git config --global user.email "[email protected]"
52+
git config --global user.name "Github Actions"
53+
rm -fr ".git/rebase-apply"
54+
rm -fr ".git/rebase-merge"
55+
git rebase origin/${BASE_REF}
56+
git clean -f -d
57+
git log --graph --oneline HEAD...${PR_HEAD}
6858
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') }}
59+
- name: Set up Python
60+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
61+
with:
62+
python-version: 3.11
7463

75-
- name: Install python dependencies
76-
run: |
77-
pip install -r scripts/requirements-compliance.txt
78-
pip install west
64+
- name: Setup Zephyr project
65+
uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6
66+
with:
67+
app-path: zephyr
68+
toolchains: all
7969

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
70+
- name: Initialize CodeQL
71+
uses: github/codeql-action/init@v3
72+
with:
73+
languages: ${{ matrix.language }}
74+
build-mode: ${{ matrix.build-mode }}
75+
source-root: zephyr
8576

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
77+
- if: matrix.build-mode == 'manual'
78+
shell: bash
79+
run: |
80+
west build -b qemu_x86 samples/hello_world
9181
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.
101-
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
104-
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}}"
82+
- name: Perform CodeQL Analysis
83+
uses: github/codeql-action/analyze@v3
84+
with:
85+
category: "/language:${{matrix.language}}"
86+
checkout_path: zephyr

0 commit comments

Comments
 (0)