Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .codechecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,16 @@ analyzer:
- --disable=clang-diagnostic-reserved-identifier
- --disable=clang-diagnostic-reserved-macro-identifier

# userspace includes c files
- --disable=bugprone-suspicious-include

- --disable=clang-diagnostic-unused-parameter
- --disable=bugprone-narrowing-conversions

# LOG_ macros
- --disable=alpha.core.SizeofPtr
- --disable=bugprone-sizeof-expression
- --disable=performance-no-int-to-ptr

# Cleanup
- --clean
1 change: 1 addition & 0 deletions .github/codechecker/skipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-lib/libc/picolibc/*
21 changes: 16 additions & 5 deletions .github/workflows/assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,27 @@ jobs:
issues: write # to add assignees to issues

steps:
- name: Install Python dependencies
run: |
pip install -U PyGithub>=1.55 west
- name: Check out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt

- name: install-packages
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
- name: install-packages
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Run assignment script
env:
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FLAGS="-v"
FLAGS+=" -o ${{ github.event.repository.owner.login }}"
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/backport_issue_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,27 @@ jobs:
- name: Check out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install Python dependencies
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt

- name: install-packages
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
- name: install-packages
run: |
pip install -U pygithub
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Run backport issue checker
env:
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
run: |
./scripts/release/list_backports.py \
-o ${{ github.event.repository.owner.login }} \
-r ${{ github.event.repository.name }} \
-b ${{ github.event.pull_request.base.ref }} \
-p ${{ github.event.pull_request.number }}
-o ${{ github.event.repository.owner.login }} \
-r ${{ github.event.repository.name }} \
-b ${{ github.event.pull_request.base.ref }} \
-p ${{ github.event.pull_request.number }}
1 change: 0 additions & 1 deletion .github/workflows/bsim-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ jobs:
- name: Merge Test Results
run: |
pip install junitparser junit2html
junitparser merge --glob "./bsim_*/*bsim_results.*.xml" "./twister-out/twister.xml" junit.xml
junit2html junit.xml junit.html
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/bug_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install Python dependencies
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt

- name: install-packages
run: |
pip install -U pygithub
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Snapshot bugs
env:
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/clang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
clang-build:
if: github.repository_owner == 'zephyrproject-rtos'
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
group: test-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
options: '--entrypoint /bin/bash'
Expand Down Expand Up @@ -135,13 +135,30 @@ jobs:
checks: write # to create GitHub annotations
if: (success() || failure())
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false

- name: Download Artifacts
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
path: artifacts

- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt

- name: install-packages
run: |
pip install -r scripts/requirements-actions.txt --require-hashes

- name: Merge Test Results
run: |
pip install junitparser junit2html
junitparser merge artifacts/*/twister.xml junit.xml
junit2html junit.xml junit-clang.html

Expand Down
122 changes: 122 additions & 0 deletions .github/workflows/codechecker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Codechecker
on:
push:
branches:
- main
- v*-branch
- collab-*
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
Codechecker:
if: github.repository_owner == 'zephyrproject-rtos'
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
options: '--entrypoint /bin/bash'
env:
CCACHE_DIR: /node-cache/ccache-zephyr
CCACHE_REMOTE_STORAGE: "redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3"
CCACHE_REMOTE_ONLY: "true"
CCACHE_IGNOREOPTIONS: '-specs=* --specs=*'
LLVM_TOOLCHAIN_PATH: /usr/lib/llvm-16
BASE_REF: ${{ github.base_ref }}
permissions:
security-events: write
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Print cloud service information
run: |
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"

- name: Clone cached Zephyr repository
continue-on-error: true
run: |
git clone --shared /repo-cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false

- name: Environment Setup
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
git config --global user.email "[email protected]"
git config --global user.name "Zephyr Bot"
rm -fr ".git/rebase-apply"
rm -fr ".git/rebase-merge"
git clean -f -d
git log --pretty=oneline | head -n 10
west init -l . || true
west config --global update.narrow true
west config manifest.group-filter -- +ci,-optional
# In some cases modules are left in a state where they can't be
# updated (i.e. when we cancel a job and the builder is killed),
# So first retry to update, if that does not work, remove all modules
# and start over. (Workaround until we implement more robust module
# west caching).
west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.log || west update --path-cache /repo-cache/zephyrproject 2>&1 1> west2.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /repo-cache/zephyrproject)

echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV

- name: Check Environment
run: |
cmake --version
${LLVM_TOOLCHAIN_PATH}/bin/clang --version
gcc --version
ls -la

- name: Run Tests with Twister
id: twister
run: |
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
export ZEPHYR_SCA_VARIANT=codechecker
export CODECHECKER_CONFIG_FILE=$ZEPHYR_BASE/.codechecker.yml
export CODECHECKER_CLEANUP=y
export CODECHECKER_EXPORT=sarif
export CODECHECKER_SKIP_FILE=$ZEPHYR_BASE/.github/codechecker/skipfile

pip install codechecker==v6.25.1 cppcheck sarif-tools
sudo apt-get update
sudo apt-get install -y jq
export PATH=/usr/lib/llvm-16/bin/:$PATH

./scripts/twister -i --force-color -N -v --build-only --timeout-multiplier 2 -p qemu_x86 -T tests/kernel/threads -T tests/lib/heap

#sarif copy --output results.sarif $(find twister-out -name "codechecker.sarif")
jq -s '{ "$schema": "https://json.schemastore.org/sarif-2.1.0", "version": "2.1.0", "runs": map(.runs) | add }' $(find twister-out -name "codechecker.sarif") > results.sarif

- name: Upload SARIF as artifact
if: always()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: sarif
if-no-files-found: ignore
path: |
build/sca/codechecker/codechecker.sarif
results.sarif

- name: Upload Analysis Results
if: always()
uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 #v3
with:
sarif_file: results.sarif
14 changes: 11 additions & 3 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ jobs:
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
mkdir -p coverage/reports
pip install gcovr==6.0
./scripts/twister -E ${{matrix.normalized}}-testplan.json
ls -la
./scripts/twister \
Expand Down Expand Up @@ -144,6 +143,17 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt

- name: install-packages
run: |
pip install -r scripts/requirements-actions.txt --require-hashes

- name: Download Artifacts
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
Expand Down Expand Up @@ -185,7 +195,6 @@ jobs:
- name: Merge coverage files
run: |
pushd ./coverage/reports
pip install gcovr==6.0
gcovr ${{ steps.get-coverage-files.outputs.mergefiles }} --merge-mode-functions=separate --json merged.json
gcovr ${{ steps.get-coverage-files.outputs.mergefiles }} --merge-mode-functions=separate --cobertura merged.xml
popd
Expand All @@ -201,7 +210,6 @@ jobs:
- name: Generate Coverage Report
if: always()
run: |
pip install xlsxwriter ijson
python3 ./scripts/ci/coverage/coverage_analysis.py \
-t native_sim-testplan.json \
-m MAINTAINERS.yml \
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/coding_guidelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: cache-pip
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/coding_guidelines.yml') }}
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt

- name: Install python dependencies
- name: install-packages
run: |
pip install unidiff
pip install sh
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Install Packages
run: |
Expand Down
Loading
Loading